cc.mallet.grmm.types
Class UnmodifiableVarSet

java.lang.Object
  extended by cc.mallet.grmm.types.UnmodifiableVarSet
All Implemented Interfaces:
VarSet, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.Set

public class UnmodifiableVarSet
extends java.lang.Object
implements VarSet, java.io.Serializable

Created: Dec 15, 2005

Version:
$Id: UnmodifiableVarSet.java,v 1.1 2007/10/22 21:37:44 mccallum Exp $
Author:
Serialized Form

Constructor Summary
UnmodifiableVarSet(VarSet subVarSet)
           
 
Method Summary
 boolean add(java.lang.Object o)
           
 boolean addAll(java.util.Collection collection)
           
 AssignmentIterator assignmentIterator()
          Returns an iterator over the assignments to this clique.
 void clear()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection collection)
           
 boolean equals(java.lang.Object o)
           
 Variable get(int idx)
          Returns the variable in this clique at index idx.
 int hashCode()
           
 VarSet intersection(VarSet c)
          Returns the intersection of two cliques.
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection collection)
           
 boolean retainAll(java.util.Collection collection)
           
 int size()
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] objects)
           
 java.lang.String toString()
           
 Variable[] toVariableArray()
          Returns the variables in this clique as an array, that should not be modified.
 java.util.Set vertices()
           
 int weight()
          Returns the number of assignments of this clique.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnmodifiableVarSet

public UnmodifiableVarSet(VarSet subVarSet)
Method Detail

get

public Variable get(int idx)
Description copied from interface: VarSet
Returns the variable in this clique at index idx.

Specified by:
get in interface VarSet
Returns:
the variable

vertices

public java.util.Set vertices()

toVariableArray

public Variable[] toVariableArray()
Description copied from interface: VarSet
Returns the variables in this clique as an array, that should not be modified.

Specified by:
toVariableArray in interface VarSet
Returns:
An array of Variables.

weight

public int weight()
Description copied from interface: VarSet
Returns the number of assignments of this clique.

Specified by:
weight in interface VarSet

assignmentIterator

public AssignmentIterator assignmentIterator()
Description copied from interface: VarSet
Returns an iterator over the assignments to this clique. Each element in the Iterator is an Assignment object.

Specified by:
assignmentIterator in interface VarSet
Returns:
An iterator over assignments

intersection

public VarSet intersection(VarSet c)
Description copied from interface: VarSet
Returns the intersection of two cliques.

Specified by:
intersection in interface VarSet

size

public int size()
Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.Set

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection
Specified by:
isEmpty in interface java.util.Set

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection
Specified by:
contains in interface java.util.Set

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in interface java.util.Set

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.Set

toArray

public java.lang.Object[] toArray(java.lang.Object[] objects)
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.Set

add

public boolean add(java.lang.Object o)
Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.Set

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.Set

containsAll

public boolean containsAll(java.util.Collection collection)
Specified by:
containsAll in interface java.util.Collection
Specified by:
containsAll in interface java.util.Set

addAll

public boolean addAll(java.util.Collection collection)
Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.Set

retainAll

public boolean retainAll(java.util.Collection collection)
Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.Set

removeAll

public boolean removeAll(java.util.Collection collection)
Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.Set

clear

public void clear()
Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.Set

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Collection
Specified by:
equals in interface java.util.Set
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection
Specified by:
hashCode in interface java.util.Set
Overrides:
hashCode in class java.lang.Object

toString

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