choco.kernel.common.util.objects
Class DeterministicIndicedList<O extends IIndex>

java.lang.Object
  extended by choco.kernel.common.util.objects.DeterministicIndicedList<O>
All Implemented Interfaces:
Serializable

public class DeterministicIndicedList<O extends IIndex>
extends Object
implements Serializable

See Also:
Serialized Form

Constructor Summary
DeterministicIndicedList(Class clazz)
          Constructor
DeterministicIndicedList(Class clazz, int initialSize)
          Constructor
 
Method Summary
 void add(O object)
          Add object to the structure
 void clear()
           
 boolean contains(O object)
          Indicates wether the structure contains the object
 O get(int i)
          Get the object in position i
 int get(O object)
          Get the position of the object
 O getLast()
           
 DisposableIterator<O> iterator()
          Iterator over objects
 int remove(O object)
          Remove object from the structure We just swap the last object and the removed object
 int size()
          Get the number of objects contained
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeterministicIndicedList

public DeterministicIndicedList(Class clazz,
                                int initialSize)
Constructor

Parameters:
clazz - the super Class of include object
initialSize - initial size of the structure

DeterministicIndicedList

public DeterministicIndicedList(Class clazz)
Constructor

Parameters:
clazz - the super Class of include object
Method Detail

clear

public void clear()

add

public void add(O object)
Add object to the structure

Parameters:
object -

remove

public int remove(O object)
Remove object from the structure We just swap the last object and the removed object

Parameters:
object - to remove

contains

public boolean contains(O object)
Indicates wether the structure contains the object

Parameters:
object -
Returns:

size

public int size()
Get the number of objects contained

Returns:

get

public O get(int i)
Get the object in position i

Parameters:
i - position of the object
Returns:
the ith object

get

public int get(O object)
Get the position of the object

Parameters:
object - required
Returns:
its position

getLast

public O getLast()

iterator

public DisposableIterator<O> iterator()
Iterator over objects

Returns:


Copyright © 2012. All Rights Reserved.