gov.nasa.pds.tools.label
Class PointerStatement

java.lang.Object
  extended by gov.nasa.pds.tools.label.Statement
      extended by gov.nasa.pds.tools.label.PointerStatement
All Implemented Interfaces:
PointerType, java.lang.Comparable
Direct Known Subclasses:
DataLocationPointer, DescriptionPointer, IncludePointer

public class PointerStatement
extends Statement
implements PointerType

This class is the object representation of a pointer statement in a label.

Version:
$Revision: 3836 $
Author:
pramirez

Field Summary
protected  boolean externalReference
           
protected  Value value
           
 
Fields inherited from class gov.nasa.pds.tools.label.Statement
context, filename, identifier, lineNumber
 
Fields inherited from interface gov.nasa.pds.tools.label.PointerType
CATALOG, CATALOG_NAMES, DATA_LOCATION, DESCRIPTION, DESCRIPTION_NAMES, INCLUDE, INCLUDE_NAMES, MAP_PROJECTION, UNDEFINED
 
Constructor Summary
protected PointerStatement(int pointerType, int lineNumber, java.lang.String identifier)
          Constructs essentially a null pointer
protected PointerStatement(int pointerType, int lineNumber, java.lang.String identifier, Value value)
          Constructs a pointer with a value on the right hand side
protected PointerStatement(java.lang.String identifier, Value value)
          Constructs a pointer with an unknown line number.
 
Method Summary
 void attachComment(CommentStatement comment)
          Attaches a comment to this pointer
 CommentStatement getComment()
          Returns the comment that occurs on the same line as this pointer assigment
 java.lang.String getExternalFileReference()
          Gets the name of the external file that this pointer references
 java.util.List getExternalFileReferences()
           
 int getPointerType()
          Indicates the type of pointer that this pointer statement represents.
 Value getValue()
          Returns the value portion (right hand side) of the statement.
 boolean hasExternalReference()
          Indicates whether or not the pointer makes reference to an external file.
 boolean hasMultipleReferences()
           
 
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, toString, wait, wait, wait
 

Field Detail

value

protected Value value

externalReference

protected boolean externalReference
Constructor Detail

PointerStatement

protected PointerStatement(int pointerType,
                           int lineNumber,
                           java.lang.String identifier)
Constructs essentially a null pointer

Parameters:
pointerType - indicates whether it is data location, include, or description pointer
lineNumber - at which the statement occurs
identifier - of the statement

PointerStatement

protected PointerStatement(int pointerType,
                           int lineNumber,
                           java.lang.String identifier,
                           Value value)
Constructs a pointer with a value on the right hand side

Parameters:
pointerType - indicates whether it is data location, include, or description pointer
lineNumber - at which the statement occurs
identifier - of the statement
value - of the assignment

PointerStatement

protected PointerStatement(java.lang.String identifier,
                           Value value)
Constructs a pointer with an unknown line number.

Parameters:
identifier - of the statement
value - of the assignment
Method Detail

getValue

public Value getValue()
Returns the value portion (right hand side) of the statement.

Returns:
value

attachComment

public void attachComment(CommentStatement comment)
Attaches a comment to this pointer

Specified by:
attachComment in class Statement
Parameters:
comment - that occurs on same line as this pointer statement

getComment

public CommentStatement getComment()
Returns the comment that occurs on the same line as this pointer assigment

Returns:
comment

getPointerType

public int getPointerType()
Indicates the type of pointer that this pointer statement represents. See PointerType

Returns:
type of pointer

hasExternalReference

public boolean hasExternalReference()
Indicates whether or not the pointer makes reference to an external file.

Returns:
flag indicating whether an external reference is made

hasMultipleReferences

public boolean hasMultipleReferences()

getExternalFileReference

public java.lang.String getExternalFileReference()
Gets the name of the external file that this pointer references

Returns:
filename associated with this pointer. Returns null if this is not an external reference or there is multiple values for external references

getExternalFileReferences

public java.util.List getExternalFileReferences()


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