net.sourceforge.cilib.container
Class StandardArray<E>

java.lang.Object
  extended by net.sourceforge.cilib.container.StandardArray<E>
All Implemented Interfaces:
Array

public class StandardArray<E>
extends Object
implements Array

Default wrapper class that implements a default array.

Author:
gpampara

Constructor Summary
StandardArray()
           
StandardArray(int elementLength)
           
 
Method Summary
 E get(int index)
          Get the element at the provided index.
<T> void
set(T object, int index)
          Set the element at index.
 int size()
          Obtain the current size of the array structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardArray

public StandardArray()

StandardArray

public StandardArray(int elementLength)
Method Detail

size

public int size()
Obtain the current size of the array structure.

Specified by:
size in interface Array
Returns:
The array length.

get

public E get(int index)
Get the element at the provided index.

Specified by:
get in interface Array
Parameters:
index - The index of the desired element.
Returns:
The element at index, if available.

set

public <T> void set(T object,
                    int index)
Set the element at index.

Specified by:
set in interface Array
Type Parameters:
T - The generic type.
Parameters:
object - The object to place within the array.
index - The index to set the object at.


Copyright © 2009 CIRG. All Rights Reserved.