|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.bddbddb.Relation
public abstract class Relation
Represents a relation in bddbddb.
| Field Summary | |
|---|---|
protected java.util.List |
attributes
Attributes of this relation. |
int |
id
Unique id number for this relation. |
protected java.lang.String |
name
Name of this relation. |
protected Relation |
negated
Negated form of this relation, or null if it doesn't exist. |
| Constructor Summary | |
|---|---|
protected |
Relation(Solver solver,
java.lang.String name,
java.util.List attributes)
Create a new Relation. |
| Method Summary | |
|---|---|
abstract boolean |
add(java.math.BigInteger[] tuple)
Adds the given tuple to this relation. |
abstract boolean |
contains(int k,
java.math.BigInteger j)
Returns true iff this relation contains a tuple where the kth field is value j. |
abstract Relation |
copy()
Make a copy of this relation. |
abstract double |
dsize()
Return the number of tuples in this relation, in double format. |
java.lang.String |
elementsToString()
|
abstract void |
free()
Free the memory associated with this relation. |
static Relation |
fromXMLElement(org.jdom.Element e,
XMLFactory f)
|
java.util.Map |
getAttribNameMap()
|
Attribute |
getAttribute(int x)
Get the attribute at the given index. |
Attribute |
getAttribute(java.lang.String x)
Get the attribute with the given name. |
java.util.List |
getAttributes()
Returns the list of attributes of this relation. |
PartialOrder.Constraints |
getConstraints()
Returns the constraints. |
Relation |
getNegated()
Return the negated form of this relation, or null if it does not exist. |
int |
hashCode()
The hashCode for relations is deterministic. |
abstract void |
initialize()
Initialize this relation. |
abstract TupleIterator |
iterator()
Return an iterator over the tuples of this relation. |
abstract TupleIterator |
iterator(java.math.BigInteger[] j)
Return an iterator over the tuples where the fields match the values in the given array. |
abstract TupleIterator |
iterator(int k)
Return an iterator over the values in the kth field of the relation. |
abstract TupleIterator |
iterator(int k,
java.math.BigInteger j)
Return an iterator over the tuples where the kth field has value j. |
abstract void |
load()
Load this relation from disk in its native format. |
abstract void |
loadTuples()
Load the tuple form of this relation from disk. |
abstract void |
loadTuples(java.lang.String filename)
Load this relation in tuple form from the given file. |
Relation |
makeNegated(Solver solver)
Get or create the negated form of this relation. |
int |
numberOfAttributes()
Returns the number of attributes. |
abstract void |
save()
Save the current value of this relation to disk in its native format. |
abstract void |
saveTuples()
Save the current value of this relation to disk in tuple form. |
abstract void |
saveTuples(java.lang.String filename)
Save the value of this relation in tuple form to the given file. |
void |
setConstraints(PartialOrder.Constraints constraints)
Set the constraints for this relation. |
long |
size()
Return the number of tuples in this relation. |
java.lang.String |
toString()
|
org.jdom.Element |
toXMLElement()
|
abstract java.lang.String |
verboseToString()
Returns a verbose representation of the relation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String name
protected java.util.List attributes
protected Relation negated
public final int id
| Constructor Detail |
|---|
protected Relation(Solver solver,
java.lang.String name,
java.util.List attributes)
solver - solvername - name of relationattributes - attributes for relation| Method Detail |
|---|
public abstract void initialize()
public abstract void load()
throws java.io.IOException
java.io.IOException
public abstract void loadTuples()
throws java.io.IOException
java.io.IOException
public abstract void loadTuples(java.lang.String filename)
throws java.io.IOException
filename - the file to load
java.io.IOException
public abstract void save()
throws java.io.IOException
java.io.IOException
public abstract void saveTuples()
throws java.io.IOException
java.io.IOException
public abstract void saveTuples(java.lang.String filename)
throws java.io.IOException
filename - name of file to save
java.io.IOExceptionpublic abstract Relation copy()
public abstract void free()
public long size()
public abstract double dsize()
public abstract TupleIterator iterator()
public abstract TupleIterator iterator(int k)
k - zero-based field number
public abstract TupleIterator iterator(int k,
java.math.BigInteger j)
k - zero-based field numberj - value
public abstract TupleIterator iterator(java.math.BigInteger[] j)
j - values
public abstract boolean contains(int k,
java.math.BigInteger j)
k - zero-based field numberj - value
public abstract boolean add(java.math.BigInteger[] tuple)
tuple - new tuple
public Relation getNegated()
public Relation makeNegated(Solver solver)
solver - solver
public java.lang.String toString()
toString in class java.lang.Objectpublic abstract java.lang.String verboseToString()
public java.lang.String elementsToString()
public java.util.List getAttributes()
public Attribute getAttribute(int x)
x - index
public Attribute getAttribute(java.lang.String x)
x - name
public int numberOfAttributes()
public PartialOrder.Constraints getConstraints()
public void setConstraints(PartialOrder.Constraints constraints)
constraints - The constraints to set.public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public java.util.Map getAttribNameMap()
public static Relation fromXMLElement(org.jdom.Element e,
XMLFactory f)
public org.jdom.Element toXMLElement()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||