edu.rice.cs.dynamicjava.symbol
Class BoundedSymbol

java.lang.Object
  extended by edu.rice.cs.dynamicjava.symbol.BoundedSymbol

public class BoundedSymbol
extends Object

Represents a type variable or wildcard. For simplicity, two kinds of symbols may be represented. Declared symbols have a name; generated symbols (including wildcards) are unnamed. In both cases, equality is defined in terms of an id object, rather than by equating names or other parameters. Clients are responsible for ensuring, where two symbols have the same id (according to equals()), that the other properties of the symbol are the same.

Each symbol has an upper and a lower bound. These may be initialized after object creation, but must be initialized exactly once before use, or an exception will occur.


Constructor Summary
BoundedSymbol(Object id)
           
BoundedSymbol(Object id, String name)
           
BoundedSymbol(Object id, String name, Type upperBound, Type lowerBound)
           
BoundedSymbol(Object id, Type upperBound, Type lowerBound)
           
 
Method Summary
 boolean equals(Object o)
           
 boolean generated()
           
 int hashCode()
           
 void initializeLowerBound(Type t)
           
 void initializeUpperBound(Type t)
           
 Type lowerBound()
           
 String name()
           
 String toString()
           
 Type upperBound()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BoundedSymbol

public BoundedSymbol(Object id)

BoundedSymbol

public BoundedSymbol(Object id,
                     String name)

BoundedSymbol

public BoundedSymbol(Object id,
                     Type upperBound,
                     Type lowerBound)

BoundedSymbol

public BoundedSymbol(Object id,
                     String name,
                     Type upperBound,
                     Type lowerBound)
Method Detail

generated

public boolean generated()

name

public String name()

initializeUpperBound

public void initializeUpperBound(Type t)

initializeLowerBound

public void initializeLowerBound(Type t)

upperBound

public Type upperBound()

lowerBound

public Type lowerBound()

toString

public String toString()
Overrides:
toString in class Object

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object