Class Type

java.lang.Object
  |
  +--Ident
        |
        +--Type

public class Type
extends Ident

This class represents a type indentifier

Author:
P. URSO

Field Summary
static Type ErrType
          Error Type.
static Type UnivType
          Universal Type.
 
Constructor Summary
Type(String name)
          Constructor of the type.
 
Method Summary
 Node constant()
          Returns the constant of the type.
 boolean equal(Type type)
          Indicates whether some other type is corresponding to this one.
 int incrNumGene()
          Increments and returns number of generated variables from this type.
 boolean isBoolean()
          Indicates if this type has boolean property.
 Node oppositeOf(Node c)
          Gives opposite of a specified boolean constant.
 void setTestSet(NodeList ts)
          Sets the test set of the type to a specified list of term.
 NodeList testSet()
          Returns test set of the type.
 String toString()
          Returns a string representation of this identifier.
 
Methods inherited from class Ident
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ErrType

public static Type ErrType
Error Type.

UnivType

public static Type UnivType
Universal Type.
Constructor Detail

Type

public Type(String name)
Constructor of the type.
Parameters:
name - name of the type.
Method Detail

incrNumGene

public int incrNumGene()
Increments and returns number of generated variables from this type.

testSet

public NodeList testSet()
Returns test set of the type.

constant

public Node constant()
Returns the constant of the type.
Returns:
a ground element of the testSet.

setTestSet

public void setTestSet(NodeList ts)
Sets the test set of the type to a specified list of term. Sets also constant of type.
Parameters:
ts - the specified node list.

isBoolean

public boolean isBoolean()
Indicates if this type has boolean property.

oppositeOf

public Node oppositeOf(Node c)
Gives opposite of a specified boolean constant.
Parameters:
c - a node.
Returns:
the other member of the test set.

equal

public boolean equal(Type type)
Indicates whether some other type is corresponding to this one.
Parameters:
type - the other type.
Returns:
true if the two Type are the same or if one of these is an ErrType.

toString

public String toString()
Returns a string representation of this identifier.
Overrides:
toString in class Ident
Returns:
the name of identifier and its type.