krati.core.array.basic
Class MemoryShortArray

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

public class MemoryShortArray
extends Object
implements ShortArray, DynamicArray


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

_subArrayBits

protected final int _subArrayBits

_subArraySize

protected final int _subArraySize

_subArrayMask

protected final int _subArrayMask

_autoExpand

protected final boolean _autoExpand
Constructor Detail

MemoryShortArray

public MemoryShortArray()
                 throws Exception
Throws:
Exception

MemoryShortArray

public MemoryShortArray(int subArrayBits)
                 throws Exception
Throws:
Exception

MemoryShortArray

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

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

set

public void set(int index,
                short value)

set

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

Specified by:
set in interface ShortArray

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

Specified by:
getInternalArray in interface ShortArray
Returns:
short array.

setArrayExpandListener

protected void setArrayExpandListener(ArrayExpandListener listener)

getArrayExpandListener

protected ArrayExpandListener getArrayExpandListener()


Copyright © 2011. All Rights Reserved.