maspack.util
Class SubListView<E>

java.lang.Object
  extended by maspack.util.SubListView<E>
All Implemented Interfaces:
java.lang.Iterable<E>, ListView<E>

public abstract class SubListView<E>
extends java.lang.Object
implements ListView<E>


Constructor Summary
SubListView(ListView<E> view)
           
 
Method Summary
 boolean contains(java.lang.Object elem)
          Returns true if a particular element is contained in this list.
 E get(int idx)
          Get the element at a particular index, or null if there is no such element.
 java.util.Iterator<E> iterator()
          Return an iterator over all elements in this list.
 int size()
          Get the number of elements in this list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubListView

public SubListView(ListView<E> view)
Method Detail

iterator

public java.util.Iterator<E> iterator()
Return an iterator over all elements in this list.

Specified by:
iterator in interface java.lang.Iterable<E>
Specified by:
iterator in interface ListView<E>
Returns:
iterator over list elements

get

public E get(int idx)
Get the element at a particular index, or null if there is no such element.

Specified by:
get in interface ListView<E>
Parameters:
idx - index of the element
Returns:
element at specified index

size

public int size()
Get the number of elements in this list.

Specified by:
size in interface ListView<E>
Returns:
number of elements

contains

public boolean contains(java.lang.Object elem)
Returns true if a particular element is contained in this list.

Specified by:
contains in interface ListView<E>
Parameters:
elem - element to search for
Returns:
true if the element is contained in this list