com.sas.util
Class VectorAccess

com.sas.util.VectorAccess
All Implemented Interfaces:
com.sas.PublicClonable, com.sas.util.Countable, IndexedGetInterface, IndexedSetInterface, java.io.Serializable, java.lang.Cloneable

public class VectorAccess
implements IndexedSetInterface, com.sas.PublicClonable, java.io.Serializable

A wrapper for a Vector so that it may be sorted with the static sort methods in Sort

See Also:
ArrayAccess, Sort, Serialized Form

Constructor Summary
VectorAccess(java.util.Vector vector)
          Construct an VectorAccess object which wraps a java.util.Vector
 
Method Summary
 java.lang.Object clone()
          Clone the object.
 int count()
          Returns the number of items in the vector
 java.lang.Object get(int index)
          Get a value via an integer index.
 void set(int index, java.lang.Object object)
          Set a value via an integer index.
 

Constructor Detail

VectorAccess

public VectorAccess(java.util.Vector vector)
Construct an VectorAccess object which wraps a java.util.Vector

Parameters:
vector - a Vector
Method Detail

get

public java.lang.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:
java.lang.IndexOutOfBoundsException - The implementor of this interface may throw this RuntimeException if the index is not valid.

set

public void set(int index,
                java.lang.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 store
Object - the object to store or associate with the index.
Throws:
java.lang.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 vector

Specified by:
count in interface com.sas.util.Countable
Returns:
the number of items in the vector

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone the object. This does not clone the vector.

Specified by:
clone in interface com.sas.PublicClonable
Overrides:
clone in class java.lang.Object
Returns:
a clone of this VectorAccess object
Throws:
java.lang.CloneNotSupportedException - if the string comparator cannot be cloned.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.