Package gov.nasa.pds.tools.label
Class ObjectStatement
- java.lang.Object
-
- gov.nasa.pds.tools.label.Statement
-
- gov.nasa.pds.tools.label.ObjectStatement
-
- All Implemented Interfaces:
Comparable<Object>
public class ObjectStatement extends Statement
- Version:
- $Revision$
- Author:
- pramirez, jagander
-
-
Field Summary
-
Fields inherited from class gov.nasa.pds.tools.label.Statement
comment, identifier, label, lineNumber, sourceFile, sourceURI
-
-
Constructor Summary
Constructors Constructor Description ObjectStatement(Label sourceLabel, int lineNumber, String identifier)Constructs a new object statement with no attributes or nested objectsObjectStatement(Label sourceLabel, int lineNumber, String identifier, LinkedHashMap<DictIdentifier,List<Statement>> statements)Constructs an ObjectStatementObjectStatement(Label sourceLabel, String identifier)Constructs an ObjectStatement with only an identifier
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStatement(Statement statement)Associates a statement with this objectbooleanequals(Object object)AttributeStatementgetAttribute(DictIdentifier id)Retrieves the named attributeAttributeStatementgetAttribute(String id)List<AttributeStatement>getAttributes()Retrieves the list of attributes associated with the ObjectStatementList<GroupStatement>getGroups()Retrieves groups associated with this objectList<GroupStatement>getGroups(DictIdentifier id)Retrieves the named groupList<GroupStatement>getGroups(String id)List<ObjectStatement>getObjects()Retrieves the list of objects associated with this objectList<ObjectStatement>getObjects(DictIdentifier id)Retrieves the named objectList<ObjectStatement>getObjects(String id)PointerStatementgetPointer(DictIdentifier id)Retrieves the named pointerList<PointerStatement>getPointers()Retrieves pointers associated with this objectList<Statement>getStatements()booleanhasAttribute(DictIdentifier id)booleanhasGroup(DictIdentifier id)inthashcode()booleanhasObject(DictIdentifier id)booleanhasPointer(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
-
-
-
-
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, LinkedHashMap<DictIdentifier,List<Statement>> statements)
Constructs an ObjectStatement- Parameters:
lineNumber- Line number of statementidentifier- Identifier of statementstatements- Map ofStatementassociated 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
Listof 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
Listof 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)
-
hashcode
public int hashcode()
-
-