public class RdcField
extends java.lang.Object
| Constructor and Description |
|---|
RdcField()
Create new instance with no contents in the field.
|
| Modifier and Type | Method and Description |
|---|---|
int |
computeLength()
Computes the number of characters in this field.
|
java.lang.String |
computePatternDouble(boolean useComma,
int numCharField,
int numDecimal) |
java.lang.String |
computePatternDouble(int numDecimal) |
java.lang.String |
computePatternDouble(int numCharField,
int numDecimal) |
static java.lang.String |
computePatternDoubleStatic(int fieldWidth,
int numDigitRightDecimal) |
static java.lang.String |
computePatternDoubleStatic(int fieldWidth,
int numDigitRightDecimal,
boolean useCommas)
Compute pattern for decimal format
|
int |
getBeginCol()
Returns the position of the first character in this field.
|
java.text.DecimalFormat |
getDecimalFormat() |
int |
getEndCol()
Returns the position of the last character in this field.
|
java.lang.StringBuffer |
getFieldContent()
Returns the string contents of this Field.
|
java.lang.StringBuffer |
getFieldContent(java.lang.String theString)
Stores and Returns the string contents of this field.
|
int |
getFieldWidthPrint() |
char |
getJustify() |
int |
getLength()
Returns the number of characters in this field.
|
int |
getNumDigits2RightOfDecimal() |
java.lang.String |
getPattern() |
char |
getSeparator()
Returns the separator that was found for this field when parsing the record.
|
boolean |
isLeftJustified() |
boolean |
isRightJustified() |
static void |
main(java.lang.String[] args) |
java.lang.String |
printDouble(char justify,
double doubleToPrint) |
java.lang.String |
printDouble(char justify,
int fieldWidth,
double doubleToPrint)
Returns String containing justified and formatted double number using previously
stored pattern and DecimalFormat.
|
static java.lang.StringBuffer |
printDouble(char justify,
int fieldWidth,
int numDigitRightDecimal,
double doubleToPrint)
Format a double number for printing.
|
java.lang.String |
printDouble(double doubleToPrint)
Returns String containing justified and formatted double number using
previously stored pattern and DecimalFormat, justification, and fieldwidth.
|
void |
printField(int j)
Prints the field parameters for field j to the standard output device.
|
java.lang.StringBuffer |
printInteger(char justify,
int sinOutWidth,
int sin) |
static java.lang.StringBuffer |
printIntegerStatic(char justify,
int sinOutWidth,
int sin)
Returns justified integer within field width.
|
java.lang.StringBuffer |
printString(char justify,
int sinOutWidth,
java.lang.String sin) |
static java.lang.StringBuffer |
printStringStatic(char justify,
int sinOutWidth,
java.lang.String sin)
Returns justified String within desired field width.
|
void |
reset()
Reset the current instance so that the contents are blank of zero length.
|
void |
setBeginCol(int beginCol)
Set the position of the first non-blank character in the field.
|
void |
setEndCol(int endCol)
Set the position of the last non-blank character in the field.
|
void |
setFieldContent(java.lang.StringBuffer fieldContent)
Set the character string for the content of this field.
|
void |
setFieldWidthPrint(int numCharsInField) |
char |
setJustify(char justify) |
void |
setLength(int numCol)
Set the number of characters in the field.
|
void |
setNumDigits2RightOfDecimal(int numDigits) |
void |
setPattern(java.lang.String pattern) |
void |
setSeparator(char separator)
Set the separator that was found for this field when parsing the record.
|
void |
setUseCommas() |
void |
setUseCommas(boolean useComma) |
java.lang.StringBuffer |
storeFieldContent(java.lang.String theString)
Set the character string for the content of this field.
|
boolean |
useCommas() |
public void reset()
public void setBeginCol(int beginCol)
public void setEndCol(int endCol)
public void setLength(int numCol)
public void setSeparator(char separator)
separator - The field separator found when parsing this field from the next.public char getSeparator()
public void setFieldContent(java.lang.StringBuffer fieldContent)
public int getBeginCol()
public int getEndCol()
public int getLength()
public int computeLength()
public java.lang.StringBuffer storeFieldContent(java.lang.String theString)
public java.lang.StringBuffer getFieldContent()
public java.lang.StringBuffer getFieldContent(java.lang.String theString)
public void printField(int j)
public void setPattern(java.lang.String pattern)
public java.lang.String getPattern()
public java.text.DecimalFormat getDecimalFormat()
public void setUseCommas(boolean useComma)
public void setUseCommas()
public boolean useCommas()
public void setFieldWidthPrint(int numCharsInField)
public int getFieldWidthPrint()
public char setJustify(char justify)
public char getJustify()
public boolean isRightJustified()
public boolean isLeftJustified()
public void setNumDigits2RightOfDecimal(int numDigits)
public int getNumDigits2RightOfDecimal()
public java.lang.String computePatternDouble(boolean useComma,
int numCharField,
int numDecimal)
public java.lang.String computePatternDouble(int numCharField,
int numDecimal)
public java.lang.String computePatternDouble(int numDecimal)
public java.lang.StringBuffer printString(char justify,
int sinOutWidth,
java.lang.String sin)
public java.lang.StringBuffer printInteger(char justify,
int sinOutWidth,
int sin)
public java.lang.String printDouble(double doubleToPrint)
doubleToPrint - doublepublic java.lang.String printDouble(char justify,
double doubleToPrint)
public java.lang.String printDouble(char justify,
int fieldWidth,
double doubleToPrint)
justify - fieldWidth - doubleToPrint - public static java.lang.StringBuffer printStringStatic(char justify,
int sinOutWidth,
java.lang.String sin)
justify - sinOutWidth - sin - public static java.lang.StringBuffer printIntegerStatic(char justify,
int sinOutWidth,
int sin)
justify - sinOutWidth - sin - public static java.lang.StringBuffer printDouble(char justify,
int fieldWidth,
int numDigitRightDecimal,
double doubleToPrint)
fieldWidth - Width of output string.numDigitRightDecimal - Number of digits to the right of the decimal point.doubleToPrint - The double number that will be formatted and returned as a StringBuffer.public static java.lang.String computePatternDoubleStatic(int fieldWidth,
int numDigitRightDecimal,
boolean useCommas)
fieldWidth - numDigitRightDecimal - public static java.lang.String computePatternDoubleStatic(int fieldWidth,
int numDigitRightDecimal)
public static void main(java.lang.String[] args)