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

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

public class PrettyGroupStatement
extends gov.nasa.pds.tools.label.GroupStatement
implements PrettyStatement

Class used to provide a string representation of a GROUP in a PDS label.

Author:
mcayanan

Field Summary
 
Fields inherited from class gov.nasa.pds.tools.label.Statement
context, filename, identifier, lineNumber
 
Constructor Summary
PrettyGroupStatement(int lineNumber, java.lang.String identifier, java.util.LinkedHashMap statements)
          Constructs the PrettyGroupStatement.
PrettyGroupStatement(java.lang.String identifier)
          Constructs the PrettyGroupStatement.
 
Method Summary
 void addStatement(gov.nasa.pds.tools.label.Statement statement)
          Associates a statement with this object.
 java.lang.String getIdentifier()
          Returns the identifier.
 java.lang.String toString(short indentLength)
          Return a string representation of the GROUP.
 java.lang.String toString(short indentLength, int equalsPosition)
          Return a string representation of the GROUP.
 
Methods inherited from class gov.nasa.pds.tools.label.GroupStatement
attachComment, getAttribute, getAttributes, getStatements, hasAttribute
 
Methods inherited from class gov.nasa.pds.tools.label.Statement
compareTo, getContext, getFilename, getLineNumber, setContext, setFilename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nasa.pds.ltdt.label.statement.PrettyStatement
toString
 

Constructor Detail

PrettyGroupStatement

public PrettyGroupStatement(java.lang.String identifier)
Constructs the PrettyGroupStatement.

Parameters:
identifier - The name that associates this object.

PrettyGroupStatement

public PrettyGroupStatement(int lineNumber,
                            java.lang.String identifier,
                            java.util.LinkedHashMap statements)
Constructs the PrettyGroupStatement.

Parameters:
lineNumber - The line number of the location of the group object in the label.
identifier - The name that identifies this object.
statements - A linked hash map of statements associated with this object.
Method Detail

getIdentifier

public java.lang.String getIdentifier()
Returns the identifier.

Overrides:
getIdentifier in class gov.nasa.pds.tools.label.Statement

addStatement

public void addStatement(gov.nasa.pds.tools.label.Statement statement)
Associates a statement with this object. This overwrites the parent method in that it allows groups and objects to be stored within a group object.

Overrides:
addStatement in class gov.nasa.pds.tools.label.GroupStatement
Parameters:
statement - to be added to object

toString

public java.lang.String toString(short indentLength)
Return a string representation of the GROUP. Nested statements will be indented appropriately.

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

toString

public java.lang.String toString(short indentLength,
                                 int equalsPosition)
Return a string representation of the GROUP. Nested statements will be indented appropriately.

Specified by:
toString in interface PrettyStatement
Parameters:
indentLength - The number of spaces to indent the GROUP.
equalsPosition - Where the equals sign will be located.
Returns:
A string representation of the GROUP.


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