pds.label
Class PDSValue

java.lang.Object
  |
  +--pds.label.PDSValue

public class PDSValue
extends java.lang.Object

PDSValue is a class that contains a value which can be associated with an element. A value also has a units description and a potential data type.

Since:
1.0

Field Summary
 int mType
          The data type for the value
 java.lang.String mUnits
          The units of the value
 java.lang.String mValue
          The value assocated with the instance
static int TYPE_LITERAL
          A literal (') string.
static int TYPE_NONE
          Data type is unspecified
static int TYPE_STRING
          A quoted (") string.
 
Constructor Summary
PDSValue()
          Creates and instance of a PDSValue
 
Method Summary
 boolean isQuoted()
          Returns true is the data type of the value is quoted.
 int length()
          Return the length of the value when formated using PDS standards.
 void print()
          Output a value formated using PDS standards.
 void print(java.io.PrintStream out, int offset, int indentLength, int maxLength)
          Output a value formated using PDS standards.
 java.lang.String wrapPad(java.lang.String text, int offset, int indentLength, int maxLength)
          Reformats a string so that it does not exceed a given length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NONE

public static final int TYPE_NONE
Data type is unspecified

See Also:
Constant Field Values

TYPE_STRING

public static final int TYPE_STRING
A quoted (") string.

See Also:
Constant Field Values

TYPE_LITERAL

public static final int TYPE_LITERAL
A literal (') string.

See Also:
Constant Field Values

mValue

public java.lang.String mValue
The value assocated with the instance


mUnits

public java.lang.String mUnits
The units of the value


mType

public int mType
The data type for the value

Constructor Detail

PDSValue

public PDSValue()
Creates and instance of a PDSValue

Method Detail

length

public int length()
Return the length of the value when formated using PDS standards. This length includes any delimiters which may surround the value as well as any units (if specified)

Since:
1.0

print

public void print()
Output a value formated using PDS standards. This will output the value delimited with the properly quotation marks for the data type, followed by the units. If no units are specified no units will be output.

Since:
1.0

print

public void print(java.io.PrintStream out,
                  int offset,
                  int indentLength,
                  int maxLength)
Output a value formated using PDS standards. This will output the value delimited with the properly quotation marks for the data type, followed by the units. If no units are specified no units will be output.

Parameters:
out - the stream to print the element to.
offset - the number of spaces the first character of the string is to be offset.
indentLength - the number of spaces to indent each line not on the same line as the keyword.
maxLength - the maximum length for any line.
Since:
1.0

isQuoted

public boolean isQuoted()
Returns true is the data type of the value is quoted.

Returns:
true if a quoted data type, false otherwise
Since:
1.0

wrapPad

public java.lang.String wrapPad(java.lang.String text,
                                int offset,
                                int indentLength,
                                int maxLength)
Reformats a string so that it does not exceed a given length. Also pads the beginning of the line with some number of spaces.

Parameters:
text - the string of text to wrap and pad.
offset - the number of spaces the first character of the string is to be offset.
indentLength - the number of spaces to indent each line not on the same line as the keyword.
maxLength - the maximum length for any line.
Returns:
the newly formatted string.
Since:
1.0