choco.kernel.memory.structure
Class StoredBipartiteVarSet<E extends Var>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by choco.kernel.memory.structure.StoredBipartiteSet<E>
              extended by choco.kernel.memory.structure.StoredBipartiteVarSet<E>
All Implemented Interfaces:
IPretty, Iterable<E>, Collection<E>, List<E>

public final class StoredBipartiteVarSet<E extends Var>
extends StoredBipartiteSet<E>
implements IPretty


Field Summary
 
Fields inherited from class choco.kernel.memory.structure.StoredBipartiteSet
elementData, last
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
StoredBipartiteVarSet(IEnvironment env)
           
 
Method Summary
 boolean add(E e)
          Add a variable to the structure.
 void clear()
          Clear datastructures for safe reuses
 boolean contains(E o)
          Returns true if this list contains the specified element.
 void ensureCapacity(int expectedSize)
          Ensure the capasities of array
 DisposableIterator<E> getInstanciatedVariableIterator()
          Iterator over instanciated variables BEWARE: initial order is not preserved
 DisposableIterator<E> getNotInstanciatedVariableIterator()
          Iterator over non instanciated variables BEWARE: initial order is not preserved
 int indexOf(E o)
          Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
 String pretty()
          pretty printing of the object.
 E remove(int index)
          removal performs a swap on a pair of elements.
 int size()
           
 E swap(int index)
          removal performs a swap on a pair of elements.
 E[] toArray()
           
 List<E> toList()
           
 String toString()
           
 
Methods inherited from class choco.kernel.memory.structure.StoredBipartiteSet
get, getQuick, quickIterator, sort
 
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray
 

Constructor Detail

StoredBipartiteVarSet

public StoredBipartiteVarSet(IEnvironment env)
Method Detail

clear

public void clear()
Clear datastructures for safe reuses

Specified by:
clear in interface Collection<E extends Var>
Specified by:
clear in interface List<E extends Var>
Overrides:
clear in class AbstractList<E extends Var>

add

public boolean add(E e)
Add a variable to the structure.

Specified by:
add in interface Collection<E extends Var>
Specified by:
add in interface List<E extends Var>
Overrides:
add in class AbstractList<E extends Var>
Parameters:
e - the new variable
Returns:
the index of the variable in the variable

ensureCapacity

public void ensureCapacity(int expectedSize)
Ensure the capasities of array

Parameters:
expectedSize - expected size

swap

public E swap(int index)
removal performs a swap on a pair of elements. Do not remove while iterating if you want to preserve the current order.

Parameters:
index - index of the object to remove
Returns:
the removed object

toList

public List<E> toList()

toArray

public E[] toArray()
Specified by:
toArray in interface Collection<E extends Var>
Specified by:
toArray in interface List<E extends Var>
Overrides:
toArray in class AbstractCollection<E extends Var>

contains

public boolean contains(E o)
Returns true if this list contains the specified element. More formally, returns true if and only if this list contains at least one element e such that (o==null ? e==null : o.equals(e)).

Parameters:
o - element whose presence in this list is to be tested
Returns:
true if this list contains the specified element

indexOf

public int indexOf(E o)
Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Parameters:
o - search object
Returns:
index of o

size

public int size()
Specified by:
size in interface Collection<E extends Var>
Specified by:
size in interface List<E extends Var>
Overrides:
size in class StoredBipartiteSet<E extends Var>

pretty

public String pretty()
Description copied from interface: IPretty
pretty printing of the object. This String is not constant and may depend on the context.

Specified by:
pretty in interface IPretty
Returns:
a readable string representation of the object

toString

public String toString()
Overrides:
toString in class AbstractCollection<E extends Var>

remove

public E remove(int index)
removal performs a swap on a pair of elements. Do not remove while iterating if you want to preserve the current order.

Specified by:
remove in interface List<E extends Var>
Overrides:
remove in class StoredBipartiteSet<E extends Var>
See Also:
AbstractList.remove(int)

getNotInstanciatedVariableIterator

public final DisposableIterator<E> getNotInstanciatedVariableIterator()
Iterator over non instanciated variables BEWARE: initial order is not preserved

Returns:
iterator

getInstanciatedVariableIterator

public final DisposableIterator<E> getInstanciatedVariableIterator()
Iterator over instanciated variables BEWARE: initial order is not preserved

Returns:
iterator


Copyright © 2012. All Rights Reserved.