choco.kernel.memory.copy
Class RcLongVector

java.lang.Object
  extended by choco.kernel.memory.copy.RcLongVector
All Implemented Interfaces:
RecomputableElement, IStateLongVector

public class RcLongVector
extends Object
implements IStateLongVector, RecomputableElement

Created by IntelliJ IDEA. User: julien Date: May 6, 2010 Time: 1:06:07 PM


Field Summary
static int MIN_CAPACITY
          Minimal capacity of a vector
 
Fields inherited from interface choco.kernel.memory.IStateLongVector
LOGGER
 
Fields inherited from interface choco.kernel.memory.copy.RecomputableElement
BOOL, DOUBLE, DOUBLEVECTOR, INT, INTVECTOR, LONG, LONGVECTOR, NB_TYPE, OBJECT, VECTOR
 
Constructor Summary
RcLongVector(EnvironmentCopying env)
          Constructs an empty stored search vector.
RcLongVector(EnvironmentCopying env, int initialSize, long initialValue)
          Constructs a stored search vector with an initial size, and initial values.
RcLongVector(EnvironmentCopying env, long[] entries)
           
 
Method Summary
 void _set(long[] vals)
           
 void _set(long[] vals, int timeStamp)
           
 void add(long i)
          Adds a new search at the end of the vector.
 boolean contain(long val)
           
 long[] deepCopy()
           
 void ensureCapacity(int minCapacity)
          Checks if the capacity is great enough, else the capacity is extended.
 long get(int index)
          Returns the indexth element of the vector.
 DisposableIntIterator getIterator()
           
 int getTimeStamp()
           
 int getType()
           
 boolean isEmpty()
          Checks if the vector is empty.
 long quickGet(int index)
          access an element without any bound check
 long quickSet(int index, long val)
          Assigns a new value val to the element indexth and return the old value without bound check
 void remove(int i)
          Removes an int.
 void removeLast()
          removes the search at the end of the vector.
 long set(int index, long val)
          Assigns a new value val to the element index.
 int size()
          Returns the current size of the stored search vector.
 int[] toArray(int[] tab)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_CAPACITY

public static final int MIN_CAPACITY
Minimal capacity of a vector

See Also:
Constant Field Values
Constructor Detail

RcLongVector

public RcLongVector(EnvironmentCopying env,
                    int initialSize,
                    long initialValue)
Constructs a stored search vector with an initial size, and initial values.

Parameters:
env - The current environment.
initialSize - The initial size.
initialValue - The initial common value.

RcLongVector

public RcLongVector(EnvironmentCopying env,
                    long[] entries)

RcLongVector

public RcLongVector(EnvironmentCopying env)
Constructs an empty stored search vector.

Parameters:
env - The current environment.
Method Detail

size

public int size()
Returns the current size of the stored search vector.

Specified by:
size in interface IStateLongVector

isEmpty

public boolean isEmpty()
Checks if the vector is empty.

Specified by:
isEmpty in interface IStateLongVector

ensureCapacity

public void ensureCapacity(int minCapacity)
Checks if the capacity is great enough, else the capacity is extended.

Parameters:
minCapacity - the necessary capacity.

add

public void add(long i)
Adds a new search at the end of the vector.

Specified by:
add in interface IStateLongVector
Parameters:
i - The search to add.

removeLast

public void removeLast()
removes the search at the end of the vector. does nothing when called on an empty vector

Specified by:
removeLast in interface IStateLongVector

get

public long get(int index)
Returns the indexth element of the vector.

Specified by:
get in interface IStateLongVector

quickGet

public long quickGet(int index)
Description copied from interface: IStateLongVector
access an element without any bound check

Specified by:
quickGet in interface IStateLongVector
Returns:

contain

public boolean contain(long val)
Specified by:
contain in interface IStateLongVector

set

public long set(int index,
                long val)
Assigns a new value val to the element index.

Specified by:
set in interface IStateLongVector

quickSet

public long quickSet(int index,
                     long val)
Description copied from interface: IStateLongVector
Assigns a new value val to the element indexth and return the old value without bound check

Specified by:
quickSet in interface IStateLongVector
Parameters:
index - the index where the value is modified
val - the new value
Returns:
the old value

toArray

public int[] toArray(int[] tab)

remove

public void remove(int i)
Description copied from interface: IStateLongVector
Removes an int.

Specified by:
remove in interface IStateLongVector
Parameters:
i - The search to remove.

_set

public void _set(long[] vals)

_set

public void _set(long[] vals,
                 int timeStamp)

deepCopy

public long[] deepCopy()

getType

public int getType()
Specified by:
getType in interface RecomputableElement

getTimeStamp

public int getTimeStamp()
Specified by:
getTimeStamp in interface RecomputableElement

getIterator

public DisposableIntIterator getIterator()
Specified by:
getIterator in interface IStateLongVector


Copyright © 2012. All Rights Reserved.