krati.core.array.basic
Class MemoryLongArray

java.lang.Object
  extended by krati.core.array.basic.MemoryLongArray
All Implemented Interfaces:
Array, DynamicArray, LongArray

public class MemoryLongArray
extends Object
implements LongArray, DynamicArray


Field Summary
protected  boolean _autoExpand
           
protected  int _subArrayBits
           
protected  int _subArrayMask
           
protected  long[][] _subArrays
           
protected  int _subArraySize
           
 
Constructor Summary
MemoryLongArray()
           
MemoryLongArray(int subArrayBits)
           
MemoryLongArray(int subArrayBits, boolean autoExpand)
           
 
Method Summary
 void clear()
          Clears this Array.
 void expandCapacity(int index)
          Expands the capacity of array to accommodate a given index.
 long get(int index)
          Gets data at a specified index.
protected  ArrayExpandListener getArrayExpandListener()
           
 long[] getInternalArray()
          Gets the internal primitive array.
 boolean hasIndex(int index)
           
 int length()
           
 void set(int index, long value)
           
 void set(int index, long value, long scn)
          Sets data at a specified index.
protected  void setArrayExpandListener(ArrayExpandListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_subArrays

protected long[][] _subArrays

_subArrayBits

protected final int _subArrayBits

_subArraySize

protected final int _subArraySize

_subArrayMask

protected final int _subArrayMask

_autoExpand

protected final boolean _autoExpand
Constructor Detail

MemoryLongArray

public MemoryLongArray()
                throws Exception
Throws:
Exception

MemoryLongArray

public MemoryLongArray(int subArrayBits)
                throws Exception
Throws:
Exception

MemoryLongArray

public MemoryLongArray(int subArrayBits,
                       boolean autoExpand)
                throws Exception
Throws:
Exception
Method Detail

clear

public void clear()
Description copied from interface: Array
Clears this Array.

Specified by:
clear in interface Array

length

public int length()
Specified by:
length in interface Array
Returns:
the current length of this Array

hasIndex

public boolean hasIndex(int index)
Specified by:
hasIndex in interface Array
Returns:
a boolean indicating an index is in the current range of this Array.

get

public long get(int index)
Description copied from interface: LongArray
Gets data at a specified index.

Specified by:
get in interface LongArray
Returns:
data at a specified index

set

public void set(int index,
                long value)

set

public void set(int index,
                long value,
                long scn)
Description copied from interface: LongArray
Sets data at a specified index.

Specified by:
set in interface LongArray

expandCapacity

public void expandCapacity(int index)
Description copied from interface: DynamicArray
Expands the capacity of array to accommodate a given index.

Specified by:
expandCapacity in interface DynamicArray
Parameters:
index - an index in the array

getInternalArray

public long[] getInternalArray()
Description copied from interface: LongArray
Gets the internal primitive array.

Specified by:
getInternalArray in interface LongArray
Returns:
long array.

setArrayExpandListener

protected void setArrayExpandListener(ArrayExpandListener listener)

getArrayExpandListener

protected ArrayExpandListener getArrayExpandListener()


Copyright © 2011. All Rights Reserved.