gov.nasa.pds.ltdt.label.statement
Class PrettyAttributeStatement

java.lang.Object
  extended by gov.nasa.pds.tools.label.Statement
      extended by gov.nasa.pds.tools.label.AttributeStatement
          extended by gov.nasa.pds.ltdt.label.statement.PrettyAttributeStatement
All Implemented Interfaces:
PrettyStatement, java.lang.Comparable

public class PrettyAttributeStatement
extends gov.nasa.pds.tools.label.AttributeStatement
implements PrettyStatement

Class to provide a "pretty print" string representation of an attribute statement in a PDS label.

Author:
mcayanan

Field Summary
 
Fields inherited from class gov.nasa.pds.tools.label.Statement
context, filename, identifier, lineNumber
 
Constructor Summary
PrettyAttributeStatement(java.lang.String identifier)
          Constructs this object with no value.
PrettyAttributeStatement(java.lang.String identifier, Value value)
          Constructs this object with an identifier and value.
 
Method Summary
 java.lang.String toString()
          Returns a string representation of the attribute with no indentation.
 java.lang.String toString(short indentLength)
          Returns a string representation of the attribute with a given indentation.
 java.lang.String toString(short indentLength, int equalsPosition)
          Returns a string representation of the attribute.
 
Methods inherited from class gov.nasa.pds.tools.label.AttributeStatement
attachComment, getElementIdentifier, getNamespace, getValue, hasNamespace, setValue
 
Methods inherited from class gov.nasa.pds.tools.label.Statement
compareTo, getContext, getFilename, getIdentifier, getLineNumber, setContext, setFilename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrettyAttributeStatement

public PrettyAttributeStatement(java.lang.String identifier)
Constructs this object with no value.

Parameters:
identifier - The data element name.

PrettyAttributeStatement

public PrettyAttributeStatement(java.lang.String identifier,
                                Value value)
Constructs this object with an identifier and value.

Parameters:
identifier - The data element name.
value - The data element value.
Method Detail

toString

public java.lang.String toString()
Returns a string representation of the attribute with no indentation. The equals position will be located 2 spaces after the identifier.

Specified by:
toString in interface PrettyStatement
Overrides:
toString in class java.lang.Object
Returns:
A string representation of the attribute.

toString

public java.lang.String toString(short indentLength)
Returns a string representation of the attribute with a given indentation.

Specified by:
toString in interface PrettyStatement
Parameters:
indentLength - The number of spaces to indent the statement.
Returns:
A string representation of the attribute.

toString

public java.lang.String toString(short indentLength,
                                 int equalsPosition)
Returns a string representation of the attribute.

Specified by:
toString in interface PrettyStatement
Parameters:
indentLength - The number of spaces to indent the statement.
equalsPosition - Where to place the equals sign.
Returns:
A string representation of the attribute.


Copyright © 2005-2008 NASA Jet Propulsion Laboratory, California Institute of Technology. All Rights Reserved.