com.sas.util
Interface IndexedSetInterface

All Superinterfaces:
com.sas.util.Countable, IndexedGetInterface
All Known Subinterfaces:
com.sas.collection.OrderedCollectionInterface, SelectionGroupInterface
All Known Implementing Classes:
ArrayAccess, com.sas.collection.OrderedCollection, SelectionGroup, VectorAccess

public interface IndexedSetInterface
extends IndexedGetInterface

IndexedSetInterface is an interface which defines a set(int, Object) method, commonly used for setting or storing items into indexed collections of objects.

The object must also implement the Countable interface which defines the valid range of indices. Most objects use zero based indexing and thus the valid set of indices would be 0..count()-1.

Usage

 for (int i = 0, count = x.count(); i < count; i++) {
    // for some object o, store it with the index i
    x.set(i, o);
 }
 

See Also:
Countable, StaticOrderedCollectionInterface

Method Summary
 void set(int index, java.lang.Object object)
          Set a value via an integer index.
 
Methods inherited from interface com.sas.util.IndexedGetInterface
get
 
Methods inherited from interface com.sas.util.Countable
count
 

Method Detail

set

void set(int index,
         java.lang.Object object)
Set a value via an integer index. This is like an array element assignment.

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.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.