java.lang.String |
addDecoration(java.lang.String aString)
Methods inherited from class com.ibm.btt.base.FormatDecorator |
format, format, getDataElementName, getDecorated, getName, isConstant, isItConstant, reinitialize, rootDecorated, rootDecorator, setDecorated, toString, unformat, unformat |
Methods inherited from class com.ibm.btt.base.FormatElement |
checkIndexes, exceptionInfo, externalizer, getExternalizer, getTagName, isCacheable, isNull, readExternal, readExternal, readObject, removeExternal, setDataElementName, setExternalizer, setName, setSize, toTags, writeExternal, writeExternal |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
length
public int length
- The length of the string after the decoration is applied.
justify
public int justify
- The justification to be applied to the string.
padCharacter
public char padCharacter
- The character to use to pad the string so that it has the specified
length.
noEmpty
public java.lang.String noEmpty
- A boolean that indicates whether to return the pad character when the
resulting string is empty after applying the decorator. The default value
is no.
FixedLength
public FixedLength()
- This is the default constructor used to create a FixedLength object.
FixedLength
public FixedLength(java.lang.String aName)
throws java.io.IOException
- This is the constructor used by the Externalizer to create a FixedLength
object.
- Parameters:
aName - java.lang.String
- Throws:
java.io.IOException
addDecoration
public java.lang.String addDecoration(java.lang.String aString)
- Adjusts the length of the String to the length specified by the length
attribute. If the String is too long, this method truncates it. If the
String is too short, this method justifies the String according to the
justify attribute and then pads it using the character specified by the
padCharacter attribute.
- Specified by:
addDecoration in class FormatDecorator
- Parameters:
aString - String
- Returns:
- String
extract
public java.lang.String[] extract(java.lang.String aString)
throws DSEInvalidArgumentException
- Extracts (strips) the substring corresponding to the format element from
the input String and returns it and the remaining String as the elements
of an array.
- Overrides:
extract in class FormatDecorator
- Parameters:
aString - String
- Returns:
- String[]
- Throws:
DSEInvalidArgumentException
getJustify
public int getJustify()
- Returns the value of justify.
- Returns:
- java.lang.Integer
getLength
public int getLength()
- Returns the value of the length attribute.
- Returns:
- java.lang.Integer
getNoEmpty
public java.lang.String getNoEmpty()
- Returns the value of noEmpty.
- Returns:
- java.lang.String
getPadCharacter
public char getPadCharacter()
- Returns the value of padCharacter.
- Returns:
- java.lang.Character
initializeFrom
public java.lang.Object initializeFrom(Tag aTag)
- Initializes a FixedLength object using the supplied Tag.
- Specified by:
initializeFrom in class FormatElement
- Parameters:
aTag - com.ibm.btt.base.Tag
- Returns:
- Object
removeDecoration
public java.lang.String removeDecoration(java.lang.String aString)
throws DSEInvalidArgumentException
- Removes the padding characters from the input String.
- Specified by:
removeDecoration in class FormatDecorator
- Parameters:
aString - String
- Returns:
- String
- Throws:
DSEInvalidArgumentException
setJustify
public void setJustify(int anInteger)
- Sets the value of justify.
- Parameters:
anInteger - java.lang.Integer
setLength
public void setLength(int anInteger)
- Sets the value of length.
- Parameters:
anInteger - java.lang.Integer
setNoEmpty
public void setNoEmpty(java.lang.String aString)
- Sets the value of noEmpty.
- Parameters:
aString - java.lang.String
setPadCharacter
public void setPadCharacter(char aCharacter)
- Sets the value of padCharacter. This is the character added to Strings to
make them the length determined by the length attribute.
- Parameters:
aCharacter - java.lang.Character
toStrings
public Vector toStrings()
- Returns a Vector containing a visual representation of the fixed length
decorator.
- Specified by:
toStrings in class FormatDecorator
- Returns:
- com.ibm.btt.base.Vector
unformat
public int unformat(int ndxFrom,
int ndxTo,
java.lang.String str,
DataElement de)
throws DSEInvalidRequestException,
DSEInvalidArgumentException
- Unformat strings that between ndxFrom and ndxTo into the DataElement.
- Overrides:
unformat in class FormatElement
- Parameters:
str - java.lang.StringndxFrom - intndxTo - intde - com.ibm.btt.base.DataElement;
- Returns:
- int
- Throws:
DSEInvalidRequestException
DSEInvalidArgumentException
unformat
public int unformat(int ndxFrom,
int ndxTo,
java.lang.String str,
Context ctx)
throws DSEInvalidRequestException,
DSEInvalidArgumentException
- Unformat strings that between ndxFrom and ndxTo into the Context.
- Overrides:
unformat in class FormatElement
- Parameters:
str - java.lang.StringndxFrom - intndxTo - intctx - com.ibm.btt.base.Context;
- Returns:
- int
- Throws:
DSEInvalidRequestException
DSEInvalidArgumentException
(c) Copyright IBM Corporation 1998, 2009
|