gov.nasa.pds.tools.label
Class ObjectStatement

java.lang.Object
  extended by gov.nasa.pds.tools.label.Statement
      extended by gov.nasa.pds.tools.label.ObjectStatement
All Implemented Interfaces:
Comparable<Object>

public class ObjectStatement
extends Statement

Version:
$Revision: 8250 $
Author:
pramirez, jagander

Field Summary
 
Fields inherited from class gov.nasa.pds.tools.label.Statement
comment, identifier, label, lineNumber, sourceFile, sourceURI
 
Constructor Summary
ObjectStatement(Label sourceLabel, int lineNumber, String identifier)
          Constructs a new object statement with no attributes or nested objects
ObjectStatement(Label sourceLabel, int lineNumber, String identifier, Map<DictIdentifier,List<Statement>> statements)
          Constructs an ObjectStatement
ObjectStatement(Label sourceLabel, String identifier)
          Constructs an ObjectStatement with only an identifier
 
Method Summary
 void addStatement(Statement statement)
          Associates a statement with this object
 boolean equals(Object object)
           
 AttributeStatement getAttribute(DictIdentifier id)
          Retrieves the named attribute
 AttributeStatement getAttribute(String id)
           
 List<AttributeStatement> getAttributes()
          Retrieves the list of attributes associated with the ObjectStatement
 List<GroupStatement> getGroups()
          Retrieves groups associated with this object
 List<GroupStatement> getGroups(DictIdentifier id)
          Retrieves the named group
 List<GroupStatement> getGroups(String id)
           
 List<ObjectStatement> getObjects()
          Retrieves the list of objects associated with this object
 List<ObjectStatement> getObjects(DictIdentifier id)
          Retrieves the named object
 List<ObjectStatement> getObjects(String id)
           
 PointerStatement getPointer(DictIdentifier id)
          Retrieves the named pointer
 List<PointerStatement> getPointers()
          Retrieves pointers associated with this object
 List<Statement> getStatements()
           
 boolean hasAttribute(DictIdentifier id)
           
 boolean hasGroup(DictIdentifier id)
           
 int hashcode()
           
 boolean hasObject(DictIdentifier id)
           
 boolean hasPointer(DictIdentifier id)
          Looks to see if this object contains a pointer with the given identifier
 
Methods inherited from class gov.nasa.pds.tools.label.Statement
attachComment, compareTo, getComment, getIdentifier, getLabel, getLineNumber, getSourceFile, getSourceString, getSourceURI, toString, validateCommentType, validateElementType, validateGroupType, validateObjectType, validatePointerType, validateType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectStatement

public ObjectStatement(Label sourceLabel,
                       int lineNumber,
                       String identifier)
Constructs a new object statement with no attributes or nested objects

Parameters:
lineNumber - Line number of the statement.
identifier - Identifier for the statement.

ObjectStatement

public ObjectStatement(Label sourceLabel,
                       String identifier)
Constructs an ObjectStatement with only an identifier

Parameters:
identifier - Identifier of the statement

ObjectStatement

public ObjectStatement(Label sourceLabel,
                       int lineNumber,
                       String identifier,
                       Map<DictIdentifier,List<Statement>> statements)
Constructs an ObjectStatement

Parameters:
lineNumber - Line number of statement
identifier - Identifier of statement
statements - Map of Statement associated with this object
Method Detail

getAttributes

public List<AttributeStatement> getAttributes()
Retrieves the list of attributes associated with the ObjectStatement

Returns:
The list of AttributeStatement

getPointers

public List<PointerStatement> getPointers()
Retrieves pointers associated with this object

Returns:
list of PointerStatement

getGroups

public List<GroupStatement> getGroups()
Retrieves groups associated with this object

Returns:
list of GroupStatement

hasPointer

public boolean hasPointer(DictIdentifier id)
Looks to see if this object contains a pointer with the given identifier

Parameters:
id - of pointer statement to look for
Returns:
flag indicating whether or not the pointer was found

getAttribute

public AttributeStatement getAttribute(DictIdentifier id)
Retrieves the named attribute

Parameters:
id -
Returns:
The named AttributeStatement or null if not found

getPointer

public PointerStatement getPointer(DictIdentifier id)
Retrieves the named pointer

Parameters:
id -
Returns:
The named PointerStatement or null if not found

getAttribute

public AttributeStatement getAttribute(String id)

getObjects

public List<ObjectStatement> getObjects()
Retrieves the list of objects associated with this object

Returns:
The list of ObjectStatement

getObjects

public List<ObjectStatement> getObjects(DictIdentifier id)
Retrieves the named object

Parameters:
id -
Returns:
The List of named objects

getObjects

public List<ObjectStatement> getObjects(String id)

getGroups

public List<GroupStatement> getGroups(DictIdentifier id)
Retrieves the named group

Parameters:
id - of the group
Returns:
the List of named groups

getGroups

public List<GroupStatement> getGroups(String id)

addStatement

public void addStatement(Statement statement)
Associates a statement with this object

Parameters:
statement - to be added to object

hasAttribute

public boolean hasAttribute(DictIdentifier id)

hasObject

public boolean hasObject(DictIdentifier id)

hasGroup

public boolean hasGroup(DictIdentifier id)

getStatements

public List<Statement> getStatements()

equals

public boolean equals(Object object)
Overrides:
equals in class Object

hashcode

public int hashcode()


Copyright © 2005-2011 Planetary Data System. All Rights Reserved.