krati.core.array.basic
Class MemoryIntArray

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

public class MemoryIntArray
extends Object
implements IntArray, DynamicArray


Field Summary
protected  boolean _autoExpand
           
protected  int _subArrayBits
           
protected  int _subArrayMask
           
protected  int[][] _subArrays
           
protected  int _subArraySize
           
 
Constructor Summary
MemoryIntArray()
           
MemoryIntArray(int subArrayBits)
           
MemoryIntArray(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.
 int get(int index)
          Gets data at a specified index.
protected  ArrayExpandListener getArrayExpandListener()
           
 int[] getInternalArray()
          Gets the internal primitive array.
 boolean hasIndex(int index)
           
 int length()
           
 void set(int index, int value)
           
 void set(int index, int 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 int[][] _subArrays

_subArrayBits

protected final int _subArrayBits

_subArraySize

protected final int _subArraySize

_subArrayMask

protected final int _subArrayMask

_autoExpand

protected final boolean _autoExpand
Constructor Detail

MemoryIntArray

public MemoryIntArray()
               throws Exception
Throws:
Exception

MemoryIntArray

public MemoryIntArray(int subArrayBits)
               throws Exception
Throws:
Exception

MemoryIntArray

public MemoryIntArray(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 int get(int index)
Description copied from interface: IntArray
Gets data at a specified index.

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

set

public void set(int index,
                int value)

set

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

Specified by:
set in interface IntArray
Throws:
Exception

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 int[] getInternalArray()
Description copied from interface: IntArray
Gets the internal primitive array.

Specified by:
getInternalArray in interface IntArray
Returns:
int array.

setArrayExpandListener

protected void setArrayExpandListener(ArrayExpandListener listener)

getArrayExpandListener

protected ArrayExpandListener getArrayExpandListener()


Copyright © 2011. All Rights Reserved.