harpoon.Tools.PatMat
Class Spec.TypeSet

java.lang.Object
  extended by harpoon.Tools.PatMat.Spec.TypeSet
Enclosing class:
Spec

public static class Spec.TypeSet
extends Object

A representation for storing Types that values can be.

See Also:
Type, PreciselyTyped

Constructor Summary
Spec.TypeSet()
          Constructs a new Spec.TypeSet.
Spec.TypeSet(int t)
          Constructs a new Spec.TypeSet with type t.
Spec.TypeSet(Spec.TypeSet ts)
          Constructs a new Spec.TypeSet with the same contents as the supplied Spec.TypeSet.
 
Method Summary
 void addAll(Spec.TypeSet ts)
          Adds all the types contained in TypeSet ts to this.
 Object clone()
          Clones a Spec.TypeSet.
 boolean contains(int type)
          Checks if this contains type.
 boolean containsSigned(int bitwidth)
          Returns true if this contains the specified signed precise type.
 boolean containsSmall()
          Returns true if this contains any small types.
 boolean containsUnsigned(int bitwidth)
          Returns true if this contains the specified unsigned precise type.
 void set(int type)
          Records that this contains type.
 void setAll()
          Records that this contains all five basic Types, { INT, LONG, FLOAT, DOUBLE, POINTER }.
 void setSignedPrecise(int numBits)
          Recordes that this contains a signed, specific precise type value
requires: 1 <= numBits <= 32
 void setUnsignedPrecise(int numBits)
          Recordes that this contains an unsigned, specific precise type value
requires: 1 <= numBits <= 32
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Spec.TypeSet

public Spec.TypeSet()
Constructs a new Spec.TypeSet.


Spec.TypeSet

public Spec.TypeSet(int t)
Constructs a new Spec.TypeSet with type t.


Spec.TypeSet

public Spec.TypeSet(Spec.TypeSet ts)
Constructs a new Spec.TypeSet with the same contents as the supplied Spec.TypeSet.

Method Detail

clone

public Object clone()
Clones a Spec.TypeSet.

Overrides:
clone in class Object

contains

public boolean contains(int type)
Checks if this contains type.
effects: Returns true if type has been turned on by a call to set(type) or setAll(). Else returns false.


containsSmall

public boolean containsSmall()
Returns true if this contains any small types.


containsSigned

public boolean containsSigned(int bitwidth)
Returns true if this contains the specified signed precise type.


containsUnsigned

public boolean containsUnsigned(int bitwidth)
Returns true if this contains the specified unsigned precise type.


set

public void set(int type)
Records that this contains type.


setSignedPrecise

public void setSignedPrecise(int numBits)
Recordes that this contains a signed, specific precise type value
requires: 1 <= numBits <= 32

Parameters:
numBits - The bit length of the type.

setUnsignedPrecise

public void setUnsignedPrecise(int numBits)
Recordes that this contains an unsigned, specific precise type value
requires: 1 <= numBits <= 32

Parameters:
numBits - The bit length of the type.

addAll

public void addAll(Spec.TypeSet ts)
Adds all the types contained in TypeSet ts to this.


setAll

public void setAll()
Records that this contains all five basic Types, { INT, LONG, FLOAT, DOUBLE, POINTER }. Note that it does not set any bits for the PreciseTypes.


toString

public String toString()
Overrides:
toString in class Object