com.sas.util
Class ArrayAccess
java.lang.Object
|
+--com.sas.util.ArrayAccess
- All Implemented Interfaces:
- Countable, IndexedGetInterface, IndexedSetInterface, PublicClonable,
- public class ArrayAccess
- extends java.lang.Object
- implements IndexedSetInterface, java.io.Serializable, PublicClonable
A wrapper for an Object[] array so that it may be sorted with the
static sort methods in Sort
- See Also:
VectorAccess,
Sort, Serialized Form
|
Constructor Summary |
ArrayAccess(Object[] array)
Construct an ArrayAccess object which wraps an Object array. |
|
Method Summary |
Object |
clone()
Clone the object. |
int |
count()
Returns the number of items in the array |
Object |
get(int index)
Get a value via an integer index.
|
void |
set(int index,
Object object)
Set a value via an integer index.
|
ArrayAccess
public ArrayAccess(Object[] array)
- Construct an ArrayAccess object which wraps an Object array.
- Parameters:
array - an object array.
get
public Object get(int index)
- Get a value via an integer index.
This is like an array reference.
- Specified by:
get in interface IndexedGetInterface
- Parameters:
index - the index of the item to fetch.- Returns:
- Object the object associated with the index.
- Throws:
IndexOutOfBoundsException - The implementor of this interface may throw
this RuntimeException if the index is not valid.
set
public void set(int index,
Object object)
- Set a value via an integer index.
This is like an array element assignment.
- Specified by:
set in interface IndexedSetInterface
- Parameters:
index - the index of the item to storeObject - the object to store or associate with the index.- Throws:
IndexOutOfBoundsException - The implementor of this interface may throw
this RuntimeException if the index is not valid.
count
public int count()
- Returns the number of items in the array
- Specified by:
count in interface Countable
- Returns:
- the number of items in the array
clone
public Object clone()
throws CloneNotSupportedException
- Clone the object. This does not clone the array.
- Specified by:
clone in interface PublicClonable- Overrides:
clone in class Object
- Throws:
CloneNotSupportedException - if the clone fails.
Copyright © 2005 SAS Institute Inc. All Rights Reserved.
javadoc generated Thu, 16 Feb 2006 02:30:21