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:
ExternalPointer

public class PointerStatement
extends Statement
implements PointerType

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

Version:
$Revision: 2606 $
Author:
pramirez

Field Summary
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
DATA_LOCATION, DESCRIPTION, DESCRIPTION_NAMES, INCLUDE, INCLUDE_NAMES, 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
 int getPointerType()
          Indicates the type of pointer that this pointer statement represents.
 Value getValue()
          Returns the value portion (right hand side) of the statement.
 
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
Constructor Detail

PointerStatement

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

Parameters:
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:
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


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