net.sf.ivmaidns.util
Interface Indexable

All Known Implementing Classes:
BooleanVector, ByteVector, CharVector, ConstPair, ConstVector, DNSMsgHeader, DNSRecord, DoubleVector, FloatVector, IntVector, LongVector, ObjectVector, ShortVector, StorageEvent

public interface Indexable

Read-only interface for indexed containers. This interface should be implemented by a class that contains a group of (typed) elements and allows at least read-only access to these elements by an integer index (from 0 to length() - 1, inclusive).

Since:
2.0
Version:
2.0
Author:
Ivan Maidanski

Method Summary
 java.lang.Object getAt(int index)
          Returns value of the element at the specified index.
 int length()
          Returns the number of elements in this container.
 

Method Detail

length

int length()
Returns the number of elements in this container. This method should not be final.

Returns:
amount (non-negative value) of elements.
See Also:
getAt(int)

getAt

java.lang.Object getAt(int index)
                       throws java.lang.ArrayIndexOutOfBoundsException
Returns value of the element at the specified index. If the value to return is primitive then it is being wrapped. This method should not be final.

Parameters:
index - the index (must be in the range) at which to return an element.
Returns:
an element (may be null) at index.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index is negative or is not less than length().
java.lang.OutOfMemoryError - if there is not enough memory.
See Also:
length()