xxl.collections
Class AbstractArray

java.lang.Object
  |
  +--xxl.collections.AbstractArray

public class AbstractArray
extends java.lang.Object
implements Array


Field Summary
protected  java.lang.Object[] array
           
static Function FACTORY_METHOD
          A factory method to create a new AbstractArray.
 
Constructor Summary
AbstractArray(int size)
          Creates a new AbstractArray.
AbstractArray(java.lang.Object[] array)
          Creates a new AbstractArray.
 
Method Summary
 java.lang.Object get(int index)
          Returns the Object at position index.
 void set(int index, java.lang.Object object)
          Sets the Object at position index to object.
 int size()
          Returns the size of the Array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACTORY_METHOD

public static final Function FACTORY_METHOD
A factory method to create a new AbstractArray. It may be invoked with or without a given array. Each implementation of Array should have a field FACTORY_METHOD which is a factory method that implements at least two variants of invoke()

array

protected java.lang.Object[] array
Constructor Detail

AbstractArray

public AbstractArray(java.lang.Object[] array)
Creates a new AbstractArray.

AbstractArray

public AbstractArray(int size)
Creates a new AbstractArray.
Method Detail

get

public java.lang.Object get(int index)
Returns the Object at position index.
Specified by:
get in interface Array

set

public void set(int index,
                java.lang.Object object)
Sets the Object at position index to object.
Specified by:
set in interface Array

size

public int size()
Returns the size of the Array.
Specified by:
size in interface Array