checkers.flow
Class Location

java.lang.Object
  extended by checkers.flow.Location

public final class Location
extends Object

Represents the location of a Tree. A tree's location may be uniquely identified by its source position (character offset) and Tree.Kind. Source position alone is not sufficient, since many trees may share the same source position (for instance, the member select "a.b" and the identifier "a" in that select have the same source position, but different kinds).

See Also:
for determining a tree's source position (character offset)

Field Summary
 Tree.Kind kind
          The tree's kind.
 Long position
          The tree's source position (as a character offset).
 
Constructor Summary
Location(long position, Tree.Kind kind)
          Creates a new Location from a position and Tree.Kind.
 
Method Summary
 boolean equals(Object obj)
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

position

public final Long position
The tree's source position (as a character offset).


kind

public final Tree.Kind kind
The tree's kind.

Constructor Detail

Location

public Location(long position,
                Tree.Kind kind)
Creates a new Location from a position and Tree.Kind.

Positions can be obtained from a tree using the SourcePositions class.

Parameters:
position - the tree's position
kind - the tree's kind
See Also:
SourcePositions
Method Detail

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object