Package com.bayesserver
Class NodeVariableCollection
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<Variable>
-
- com.bayesserver.NodeVariableCollection
-
public final class NodeVariableCollection extends AbstractList<Variable>
Represents the collection of variables belonging to a- See Also:
.
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, Variable item)Inserts an element into the collection at the specified index.voidclear()Removes all elements from the collection.booleancontains(Object o)Determines whether aVariableis in the collection.Variableget(int index)Gets theVariableobject at the specified index.Variableget(String name)Performs a case sensitive lookup.Variableget(String name, boolean throwIfNotFound)Performs a case sensitive lookup.NodegetNode()TheNodethe collection belongs to.intindexOf(Object o)Determines the index of a specificVariablein the collection.Variableremove(int index)Removes an element from the collection at the specified index.booleanremove(Variable item)Removes theVariablefrom the collection.Variableset(int index, Variable value)Sets theVariableobject at the specified index.intsize()Gets the number of elements contained in theNodeVariableCollectioninstance.-
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Method Detail
-
size
public int size()
Gets the number of elements contained in theNodeVariableCollectioninstance.- Specified by:
sizein interfaceCollection<Variable>- Specified by:
sizein interfaceList<Variable>- Specified by:
sizein classAbstractCollection<Variable>
-
indexOf
public int indexOf(Object o)
Determines the index of a specificVariablein the collection.
-
contains
public boolean contains(Object o)
Determines whether aVariableis in the collection.- Specified by:
containsin interfaceCollection<Variable>- Specified by:
containsin interfaceList<Variable>- Overrides:
containsin classAbstractCollection<Variable>- Parameters:
o- TheVariableto locate in the collection. The value can be null.- Returns:
- true if [o] is found in the collection; otherwise, false.
-
add
public void add(int index, Variable item)Inserts an element into the collection at the specified index.- Specified by:
addin interfaceList<Variable>- Overrides:
addin classAbstractList<Variable>- Parameters:
index- The zero based index at which to add the element.item- The item to insert. Cannot be null.- Throws:
NullPointerException- Raised if [item] is null.IllegalStateException- Raised if the new variable already belongs to a node.IllegalArgumentException- index is less than 0.-or-index is equal to or greater than the collection count.
-
clear
public void clear()
Removes all elements from the collection.- Specified by:
clearin interfaceCollection<Variable>- Specified by:
clearin interfaceList<Variable>- Overrides:
clearin classAbstractList<Variable>
-
remove
public boolean remove(Variable item)
Removes theVariablefrom the collection.- Parameters:
item- TheVariableto be removed from the collection.- Returns:
- true if item was successfully removed from the collection; otherwise, false. This method also returns false if item is not found in the collection.
- Throws:
NullPointerException- Raised if [item] is null.
-
remove
public Variable remove(int index)
Removes an element from the collection at the specified index.- Specified by:
removein interfaceList<Variable>- Overrides:
removein classAbstractList<Variable>- Parameters:
index- The zero based index at which to remove the element.- Throws:
IllegalArgumentException- index is less than 0.-or-index is equal to or greater than the collection count.
-
set
public Variable set(int index, Variable value)
Sets theVariableobject at the specified index.
-
-