jif.types
Class VarMap

java.lang.Object
  |
  +--jif.types.VarMap

public class VarMap
extends java.lang.Object

maps variable components to labels. Whether these labels are interpreted as upper bounds, lower bounds, or just labels depends on the use of the VarMap. If a variable v is in the map when boundOf(v) is called, boundOf(v) will return the label defaultBound, and enter the mapping v->defaultBound into the map, so that next time boundOf(v) is called, the same label will be returned, even if the default bound has changed in the meantime, through the setDefaultBound(Label) method. The defaultLabel defaults to ts.topLabel().


Constructor Summary
  VarMap(JifTypeSystem ts)
           
  VarMap(JifTypeSystem ts, Label defaultBound)
           
protected VarMap(JifTypeSystem ts, java.util.Map bounds)
           
protected VarMap(JifTypeSystem ts, java.util.Map bounds, Label defaultBound)
           
 
Method Summary
 Label applyTo(Label c)
           
 polyglot.types.Type applyTo(polyglot.types.Type t)
           
 Label boundOf(DynamicLabel v)
           
 Label boundOf(VarLabel v)
           
 VarMap copy()
           
 void dump(polyglot.util.CodeWriter w)
           
 boolean isEmpty()
           
 void print()
           
 void setBound(DynamicLabel v, Label bound)
           
 void setBound(VarLabel v, Label bound)
           
 void setDefaultBound(Label defaultBound)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VarMap

public VarMap(JifTypeSystem ts)

VarMap

public VarMap(JifTypeSystem ts,
              Label defaultBound)

VarMap

protected VarMap(JifTypeSystem ts,
                 java.util.Map bounds)

VarMap

protected VarMap(JifTypeSystem ts,
                 java.util.Map bounds,
                 Label defaultBound)
Method Detail

copy

public VarMap copy()

boundOf

public Label boundOf(VarLabel v)

setBound

public void setBound(VarLabel v,
                     Label bound)

boundOf

public Label boundOf(DynamicLabel v)

setBound

public void setBound(DynamicLabel v,
                     Label bound)

setDefaultBound

public void setDefaultBound(Label defaultBound)

applyTo

public Label applyTo(Label c)

applyTo

public polyglot.types.Type applyTo(polyglot.types.Type t)

isEmpty

public boolean isEmpty()

print

public void print()

dump

public void dump(polyglot.util.CodeWriter w)