ESC/Java2
© 2003,2004,2005 David Cok and Joseph Kiniry
© 2005 UCD Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

javafe.ast
Class CompoundName

java.lang.Object
  extended byjavafe.ast.ASTNode
      extended byjavafe.ast.Name
          extended byjavafe.ast.CompoundName
All Implemented Interfaces:
java.lang.Cloneable

public class CompoundName
extends Name


Field Summary
 IdentifierVec ids
           
 int[] locDots
           
 int[] locIds
           
 
Fields inherited from class javafe.ast.Name
emptyStringArray
 
Fields inherited from class javafe.ast.ASTNode
decorations
 
Constructor Summary
protected CompoundName()
          Construct a raw CompoundName whose class invariant(s) have not yet been established.
 
Method Summary
 void accept(Visitor v)
          Accept a visit from v.
 java.lang.Object accept(VisitorArgResult v, java.lang.Object o)
           
 void check()
           
 java.lang.Object childAt(int index)
          Return the first-but-ith child of a node.
 int childCount()
          Return the number of children a node has.
 boolean equals(java.lang.Object other)
          Return true if other is a Name that is component-wise equal to this.
 int getStartLoc()
           
 int getTag()
          Return the tag of a node.
 int hashCode()
          Return a hash code for this such that two Names that are equals have the same hash code.
 Identifier identifierAt(int i)
          Return the ith identifier of this.
 int locDotAfter(int i)
          Return the location of the dot after the ith identifier of this.
 int locIdAt(int i)
          Return the location of the ith identifier of this.
static CompoundName make(IdentifierVec ids, int[] locIds, int[] locDots)
           
private  void postCheck()
          Check invariants on sizes.
private  void postMake()
          Ensure there's at least two identifiers in this name.
 Name prefix(int len)
          Return a Name consisting of the first len identifiers of this.
 java.lang.String printName()
          Return our printname, which will be of one of the forms X, X.Y, X.Y.Z, ...
 int size()
          Return the number of identifiers in this.
 java.lang.String toString()
          Return a string representation of this.
 java.lang.String[] toStrings(int len)
          Return the first len identifiers in this in an array.
 
Methods inherited from class javafe.ast.Name
getEndLoc, make, make, toStrings
 
Methods inherited from class javafe.ast.ASTNode
clone, clone, getDecorations, setDecorations
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ids

public IdentifierVec ids

locIds

public int[] locIds

locDots

public int[] locDots
Constructor Detail

CompoundName

protected CompoundName()
Construct a raw CompoundName whose class invariant(s) have not yet been established. It is the caller's job to initialize the returned node's fields so that any class invariants hold.

Method Detail

postMake

private void postMake()
Ensure there's at least two identifiers in this name.


postCheck

private void postCheck()
Check invariants on sizes.


printName

public java.lang.String printName()
Description copied from class: Name
Return our printname, which will be of one of the forms X, X.Y, X.Y.Z, ...

Specified by:
printName in class Name
Returns:
a String representation of this in Java's syntax.

equals

public boolean equals(java.lang.Object other)
Return true if other is a Name that is component-wise equal to this.

Specified by:
equals in class Name

prefix

public Name prefix(int len)
Return a Name consisting of the first len identifiers of this. Requires that len is greater than zero and less than the length of this.

Specified by:
prefix in class Name

hashCode

public int hashCode()
Return a hash code for this such that two Names that are equals have the same hash code.

Specified by:
hashCode in class Name

toStrings

public java.lang.String[] toStrings(int len)
Description copied from class: Name
Return the first len identifiers in this in an array. Requires that len be between 0 and length of this inclusive.

Specified by:
toStrings in class Name
Returns:
the first len identifiers in this in an array. Requires that len be between 0 and length of this inclusive.

size

public int size()
Return the number of identifiers in this.

Specified by:
size in class Name

identifierAt

public Identifier identifierAt(int i)
Return the ith identifier of this.

Specified by:
identifierAt in class Name

locIdAt

public int locIdAt(int i)
Return the location of the ith identifier of this.

Specified by:
locIdAt in class Name

locDotAfter

public int locDotAfter(int i)
Return the location of the dot after the ith identifier of this.

Specified by:
locDotAfter in class Name

getStartLoc

public int getStartLoc()
Specified by:
getStartLoc in class ASTNode

make

public static CompoundName make(IdentifierVec ids,
                                int[] locIds,
                                int[] locDots)

childCount

public final int childCount()
Description copied from class: ASTNode
Return the number of children a node has.

Specified by:
childCount in class ASTNode

childAt

public final java.lang.Object childAt(int index)
Description copied from class: ASTNode
Return the first-but-ith child of a node.

Specified by:
childAt in class ASTNode

toString

public final java.lang.String toString()
Description copied from class: ASTNode
Return a string representation of this. Meant for debugging use only, not for presentation.

Specified by:
toString in class ASTNode

getTag

public final int getTag()
Description copied from class: ASTNode
Return the tag of a node.

Specified by:
getTag in class ASTNode

accept

public final void accept(Visitor v)
Description copied from class: ASTNode
Accept a visit from v. This method simply calls the method of v corresponding to the allocated type of this, passing this as the argument. See the design patterns book.

Specified by:
accept in class ASTNode

accept

public final java.lang.Object accept(VisitorArgResult v,
                                     java.lang.Object o)
Specified by:
accept in class ASTNode

check

public void check()
Overrides:
check in class Name

ESC/Java2
© 2003,2004,2005 David Cok and Joseph Kiniry
© 2005 UCD Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

The ESC/Java2 Project Homepage