edu.umd.cfar.lamp.viper.util
Interface ArbitraryIndexList

All Known Implementing Classes:
LengthwiseEncodedList

public interface ArbitraryIndexList

A list that is indexed with 'Comparable' instead of ints.


Method Summary
 java.lang.Object get(java.lang.Comparable index)
          Get the value at the specified index in the list.
 java.util.Iterator iterator()
          An iterator over all the DynamicValue elements of the list.
 boolean remove(java.lang.Comparable start, java.lang.Comparable stop)
          Removes all values at the given range.
 void set(java.lang.Comparable start, java.lang.Comparable stop, java.lang.Object value)
          Sets the value at the given range.
 

Method Detail

get

public java.lang.Object get(java.lang.Comparable index)
Get the value at the specified index in the list.

Parameters:
index - the index into the list
Returns:
the value at the specified index

set

public void set(java.lang.Comparable start,
                java.lang.Comparable stop,
                java.lang.Object value)
Sets the value at the given range. Note that, like SortedMap, this means that value is set in the range from start, inclusive, to stop, exclusive.

Parameters:
start - the first index to set
stop - the first index that is not set
value - all elements in the list in the range [start, stop) will take this value
Throws:
java.lang.IllegalArgumentException - if start is not less than stop

remove

public boolean remove(java.lang.Comparable start,
                      java.lang.Comparable stop)
Removes all values at the given range. Note that, like SortedMap, this means that value is set in the range from start, inclusive, to stop, exclusive.

Parameters:
start - the first index to remove
stop - the first index that is not removed
Returns:
true if any elements were removed

iterator

public java.util.Iterator iterator()
An iterator over all the DynamicValue elements of the list.

Returns:
the elements of the list, in order