tuffy.mln
Class Type

java.lang.Object
  extended by tuffy.mln.Type

public class Type
extends java.lang.Object

A domain/type of constants; i.e., a subset of constants.


Field Summary
static Type Bool
           
private  java.util.HashSet<java.lang.Integer> domain
          The domain of variable values.
static Type Float
           
static Type Generic
          Built-in types
static Type Integer
           
private  boolean isNonSymbolicType
           
 java.lang.String name
          Name of this Type.
private  Type nonSymbolicType
           
private  java.lang.String relName
          Name of the relational table corresponding to this type.
static Type String
           
 
Constructor Summary
Type(java.lang.String name)
          Constructor of Type.
 
Method Summary
 void addConstant(int con)
          Add a constant to this type.
 boolean contains(int x)
          Return true if this type contains the constant x
 Type getNonSymbolicType()
           
 java.lang.String getNonSymbolicTypeInSQL()
           
 java.lang.String getRelName()
          Return the name of the DB relational table of this type.
 boolean isNonSymbolicType()
          See if this type is non-symbolic.
 java.lang.String name()
          Return the name of this type.
 int size()
          Return the number of constants in this type domain.
 void storeConstantList(RDB db)
          Store the list of constants in a DB table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Generic

public static Type Generic
Built-in types


Float

public static Type Float

Integer

public static Type Integer

String

public static Type String

Bool

public static Type Bool

isNonSymbolicType

private boolean isNonSymbolicType

nonSymbolicType

private Type nonSymbolicType

domain

private java.util.HashSet<java.lang.Integer> domain
The domain of variable values. The members of a domain are named as integer.


name

public java.lang.String name
Name of this Type.


relName

private java.lang.String relName
Name of the relational table corresponding to this type. Here it is type_$name.

Constructor Detail

Type

public Type(java.lang.String name)
Constructor of Type.

Parameters:
name - the name of this new type; it must be unique among all types
Method Detail

isNonSymbolicType

public boolean isNonSymbolicType()
See if this type is non-symbolic. "Non-symbolic" means that the value of this type is directly stored in the predicate table, whereas values of a "symbolic" (default) type are represented by unique IDs as per the symbol table.

Returns:

getNonSymbolicType

public Type getNonSymbolicType()

getNonSymbolicTypeInSQL

public java.lang.String getNonSymbolicTypeInSQL()

getRelName

public java.lang.String getRelName()
Return the name of the DB relational table of this type.


storeConstantList

public void storeConstantList(RDB db)
Store the list of constants in a DB table.

Parameters:
db -

addConstant

public void addConstant(int con)
Add a constant to this type.

Parameters:
con - the constant to be added

contains

public boolean contains(int x)
Return true if this type contains the constant x


size

public int size()
Return the number of constants in this type domain.


name

public java.lang.String name()
Return the name of this type.