net.sf.bddbddb
Class Domain

java.lang.Object
  extended by net.sf.bddbddb.Domain

public class Domain
extends java.lang.Object

A Domain represents a domain in bddbddb. Domain objects are globally unique: There is only one Domain object for each domain in the system.

Version:
$Id: Domain.java 513 2005-04-18 20:30:57Z joewhaley $
Author:
jwhaley

Field Summary
protected  jwutil.collections.IndexMap map
          Optional map from element numbers to string representations.
protected  java.lang.String name
          Name of domain.
protected  java.math.BigInteger size
          Number of elements in domain.
 
Method Summary
 jwutil.collections.IndexMap getMap()
          Return the map for this domain if it exists, null otherwise.
 java.math.BigInteger getSize()
          Returns the size of this domain.
 void loadMap(java.io.BufferedReader in)
          Load the string map for this domain.
 int namedConstant(java.lang.String constant)
          Returns the index of the given named constant in this domain.
 void setSize(java.math.BigInteger size)
          Sets the size of this domain.
 java.lang.String toString()
           
 java.lang.String toString(java.math.BigInteger v)
          Returns the string representation of the given element in this domain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Name of domain.


size

protected java.math.BigInteger size
Number of elements in domain.


map

protected jwutil.collections.IndexMap map
Optional map from element numbers to string representations.

Method Detail

loadMap

public void loadMap(java.io.BufferedReader in)
             throws java.io.IOException
Load the string map for this domain.

Parameters:
in - input stream of this map
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getSize

public java.math.BigInteger getSize()
Returns the size of this domain.

Returns:
size of domain

setSize

public void setSize(java.math.BigInteger size)
Sets the size of this domain.

Parameters:
size - new size

toString

public java.lang.String toString(java.math.BigInteger v)
Returns the string representation of the given element in this domain.

Parameters:
v - element number
Returns:
string representation

getMap

public jwutil.collections.IndexMap getMap()
Return the map for this domain if it exists, null otherwise.

Returns:
map for this domain, or null

namedConstant

public int namedConstant(java.lang.String constant)
Returns the index of the given named constant in this domain. If it doesn't exist, output a warning message and add it to the domain, giving it a new index.

Parameters:
constant - named constant to get
Returns:
index


Copyright © 2004-2008 Stanford SUIF Compiler Group. All Rights Reserved.