jif.types.label
Class VarLabel_c

java.lang.Object
  extended by polyglot.types.TypeObject_c
      extended by jif.types.label.Label_c
          extended by jif.types.label.VarLabel_c
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Label, Variable, VarLabel, Param, polyglot.types.TypeObject, polyglot.util.Copy

public class VarLabel_c
extends Label_c
implements VarLabel

An implementation of the VarLabel interface.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class jif.types.label.Label_c
description, toJava, variables
 
Fields inherited from class polyglot.types.TypeObject_c
position, ts
 
Constructor Summary
protected VarLabel_c()
           
  VarLabel_c(java.lang.String name, java.lang.String description, JifTypeSystem ts, polyglot.util.Position pos)
           
 
Method Summary
 java.lang.String componentString(java.util.Set printedLabels)
           
 boolean equalsImpl(polyglot.types.TypeObject o)
           
 int hashCode()
           
 boolean isCanonical()
           
 boolean isComparable()
          Is this label comparable to other labels?
 boolean isCovariant()
          Is this label covariant?
 boolean isDisambiguatedImpl()
          Check if the label is disambiguated, without recursing into child labels.
 boolean isEnumerable()
          Are the components of this label enumerable?
 boolean isRuntimeRepresentable()
           
 boolean leq_(Label L, LabelEnv env, LabelEnv.SearchState state)
          Implementation of leq, should only be called by JifTypeSystem
 boolean mustRuntimeRepresentable()
          Does this var label need to map to a runtime representable label?
 java.lang.String name()
           
 void setMustRuntimeRepresentable()
          Set the mustRuntimeRepresentable flag, meaning that any solution for this VarLabel must be to a runtime representable label.
 java.util.Set variableComponents()
          The set of variables that this label contains as components.
 java.util.Set variables()
          The set of variables that this label contains including variables contained in upper bounds of arg labels.
 
Methods inherited from class jif.types.label.Label_c
componentString, confProjection, copy, description, hasVariableComponents, hasVariables, hasWritersToReaders, integProjection, isBottom, isDisambiguated, isInvariant, isTop, labelCheck, normalize, setDescription, simplify, simplifyImpl, subst, throwTypes, toJava, toString, toString
 
Methods inherited from class polyglot.types.TypeObject_c
equals, position, typeSystem
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jif.types.label.Label
componentString, confProjection, description, hasVariableComponents, hasVariables, hasWritersToReaders, integProjection, isBottom, isDisambiguated, isInvariant, isTop, labelCheck, normalize, setDescription, simplify, subst, throwTypes, toJava, toString
 
Methods inherited from interface polyglot.types.TypeObject
position, typeSystem
 
Methods inherited from interface polyglot.util.Copy
copy
 

Constructor Detail

VarLabel_c

protected VarLabel_c()

VarLabel_c

public VarLabel_c(java.lang.String name,
                  java.lang.String description,
                  JifTypeSystem ts,
                  polyglot.util.Position pos)
Method Detail

isEnumerable

public boolean isEnumerable()
Description copied from interface: Label
Are the components of this label enumerable?

For example, Singletons are enumerable, JoinLabels are enumerable, RuntimeLabel (the label of all runtime representable components) is not enumerable. NOTE: The components of a label are not neccessarily stuck together with a join operation. For example, the MeetLabel uses the meet operation between its components.

Specified by:
isEnumerable in interface Label

isComparable

public boolean isComparable()
Description copied from interface: Label
Is this label comparable to other labels?

For example, an UnknownLabel is not comparable to others, neither is a VarLabel. Most other labels are.

Specified by:
isComparable in interface Label

isCanonical

public boolean isCanonical()
Specified by:
isCanonical in interface Param
Specified by:
isCanonical in interface polyglot.types.TypeObject

isDisambiguatedImpl

public boolean isDisambiguatedImpl()
Description copied from class: Label_c
Check if the label is disambiguated, without recursing into child labels.

Specified by:
isDisambiguatedImpl in class Label_c

isRuntimeRepresentable

public boolean isRuntimeRepresentable()
Specified by:
isRuntimeRepresentable in interface Label
Specified by:
isRuntimeRepresentable in interface Param

isCovariant

public boolean isCovariant()
Description copied from interface: Label
Is this label covariant?

Specified by:
isCovariant in interface Label

setMustRuntimeRepresentable

public void setMustRuntimeRepresentable()
Description copied from interface: Variable
Set the mustRuntimeRepresentable flag, meaning that any solution for this VarLabel must be to a runtime representable label.

Specified by:
setMustRuntimeRepresentable in interface Variable

mustRuntimeRepresentable

public boolean mustRuntimeRepresentable()
Description copied from interface: Variable
Does this var label need to map to a runtime representable label?

Specified by:
mustRuntimeRepresentable in interface Variable

componentString

public java.lang.String componentString(java.util.Set printedLabels)
Specified by:
componentString in interface Label
Specified by:
componentString in class Label_c

equalsImpl

public boolean equalsImpl(polyglot.types.TypeObject o)
Specified by:
equalsImpl in interface polyglot.types.TypeObject
Specified by:
equalsImpl in class Label_c

hashCode

public int hashCode()
Overrides:
hashCode in class polyglot.types.TypeObject_c

leq_

public boolean leq_(Label L,
                    LabelEnv env,
                    LabelEnv.SearchState state)
Description copied from interface: Label
Implementation of leq, should only be called by JifTypeSystem

Specified by:
leq_ in interface Label
Parameters:
L - the label to determine if this label is leq to. This label always satisfies !this.equals(L)
env - the label environment (including principal hierarchy). Will always be non-null.

variableComponents

public java.util.Set variableComponents()
Description copied from interface: Label
The set of variables that this label contains as components. This is a subset of variables(), since it does not count var labels contained in upper bounds of arg labels.

Specified by:
variableComponents in interface Label
Overrides:
variableComponents in class Label_c

variables

public java.util.Set variables()
Description copied from interface: Label
The set of variables that this label contains including variables contained in upper bounds of arg labels.

Specified by:
variables in interface Label
Overrides:
variables in class Label_c

name

public java.lang.String name()
Specified by:
name in interface Variable