byucc.jhdl.util.BVFormat
Class FieldFormat

java.lang.Object
  extended bybyucc.jhdl.util.BVFormat.FieldFormat
Direct Known Subclasses:
FieldFormatInteger, FieldFormatLiteral

public abstract class FieldFormat
extends java.lang.Object

Abstract class used for formatting fields.


Field Summary
protected  int minWidth
          Optional minimum width for a field.
 
Constructor Summary
protected FieldFormat(int minWidth)
          Constructor for the FieldFormat object.
 
Method Summary
 java.lang.String formatField(BV field)
          Method called by the user to format a field.
protected abstract  java.lang.String formatField(BV field, boolean fractional)
          This method is written by the subclasses of FieldFormat.
 int getMinWidth()
          Accessor method for minWidth.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minWidth

protected int minWidth
Optional minimum width for a field.

Constructor Detail

FieldFormat

protected FieldFormat(int minWidth)
Constructor for the FieldFormat object.

Parameters:
minWidth - Optional minimum width. A value less than or equal to zero means that there is no minumum width.
Method Detail

getMinWidth

public int getMinWidth()
Accessor method for minWidth.

Returns:
Minumum width of this field. A value less than or equal to zero indicates no minimum width.

formatField

public final java.lang.String formatField(BV field)
Method called by the user to format a field.

Parameters:
field - This BV is the entire BV. The correct ranges will be gotten by subclasses of this class.

formatField

protected abstract java.lang.String formatField(BV field,
                                                boolean fractional)
This method is written by the subclasses of FieldFormat.

Parameters:
field - This BV is the entire BV. The correct ranges will need to be gotten by subclasses of this class.
fractional - Tells whether or not this field represents a fraction (if true) or a whole number (if false).


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.