|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--pds.label.PDSElement
PDSElement is a class that contains a single definition or line as specified in the PDS Object Defnition Language (ODL). In this context a line may be an simple line of text, a block of commented text, or a keyword/value pair. A value may extend over more than one physical line if it is quoted or part of a value set.
Field Summary | |
java.lang.String |
mComment
The comment text found within the element. |
java.lang.String |
mKeyword
The text found before the equal sign of an element. |
int |
mLineCount
The count of the number of physical lines parsed into this element |
int |
mMaxLength
Maximum line length when printing. |
java.lang.String |
mRaw
The raw line as read from the file. |
boolean |
mSyntaxError
Indicates whether a symtax error occurred will parsing or reading a line. |
int |
mType
The basic type of the value. |
java.util.ArrayList |
mValue
An array containing a PDSValue object for each value following the equal sign in the element. |
static int |
TYPE_NONE
Unspecified grouping type. |
static int |
TYPE_ORDERED
Ordered list of values. |
static int |
TYPE_UNORDERED
An unordered list of values. |
Constructor Summary | |
PDSElement()
Creates an instance of a PDSElement |
Method Summary | |
pds.label.PDSElement |
copy()
Create a copy of the element and return a new instance of a PDSElement. |
boolean |
parse(java.io.FileInputStream file)
Parses the next element from a file stream. |
boolean |
parseValue(java.lang.String buffer)
Parses a string as a value according to the PDS Object Defnition Language (ODL). |
void |
print(int indent,
int equal,
int level)
Print the element according to PDS specifications for label files to Syste.out. |
void |
print(java.io.PrintStream out,
int indent,
int equal,
int level)
Print the element according to PDS specifications for label files. |
void |
printSpaces(java.io.PrintStream out,
int count)
Print a string of spaces to an output stream. |
java.lang.String |
readLine(java.io.FileInputStream file)
Read the next element definition from an input file stream. |
java.lang.String |
units(int index)
Returns the units associated with the value item in the value array that is assocaited with the given index. |
java.lang.String |
value(int index)
Returns the value associated with the value item in the value array that is assocaited with the given index. |
int |
valueSize()
Returns the number of values in the value list. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TYPE_NONE
public static final int TYPE_ORDERED
public static final int TYPE_UNORDERED
public java.lang.String mKeyword
public java.util.ArrayList mValue
public int mType
public java.lang.String mComment
public java.lang.String mRaw
public int mMaxLength
public int mLineCount
public boolean mSyntaxError
Constructor Detail |
public PDSElement()
Method Detail |
public boolean parse(java.io.FileInputStream file)
file
- the input file stream
true
if an element was parsed from the stream;
false
if the end of file or an error was encountered.FileInputStream
public java.lang.String readLine(java.io.FileInputStream file)
file
- the input file stream
true
if an element was parsed from the stream;
false
if the end of file or an error was encountered.FileInputStream
public boolean parseValue(java.lang.String buffer)
buffer
- the string to parse as a value.
true
if an value was parsed from properly;
false
if the an error was encountered.public int valueSize()
public java.lang.String value(int index)
index
- the index of the value to return.
public java.lang.String units(int index)
index
- the index of the value to return.
public pds.label.PDSElement copy()
public void print(int indent, int equal, int level)
indent
- the number of spaces to indent for each level.equal
- the number of spaces from the end of the indent
to align the equal sign for elements which have
a keyword and value.level
- the current level of indenting. The number of spaces
the element will be indented is level*indentpublic void print(java.io.PrintStream out, int indent, int equal, int level)
out
- the stream to print the element to.indent
- the number of spaces to indent for each level.equal
- the number of spaces from the end of the indent
to align the equal sign for elements which have
a keyword and value.level
- the current level of indenting. The number of spaces
the element will be indented is level*indentpublic void printSpaces(java.io.PrintStream out, int count)
out
- the stream to print the element to.count
- the number of spaces to print.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |