net.sf.molae.pipe.text
Class BreakTokenList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<String>
              extended by net.sf.molae.pipe.text.BreakTokenList
All Implemented Interfaces:
Iterable<String>, Collection<String>, List<String>

public final class BreakTokenList
extends AbstractSequentialList<String>

A list that is based on a BreakIterator.


Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
BreakTokenList(BreakIterator breakIterator, String text)
          Constructs a BreakTokenList object.
 
Method Summary
 ListIterator<String> listIterator(int index)
          Creates a list iterator based on the underlying break iterator.
 int size()
          Returns the number of elements in this list.
 
Methods inherited from class java.util.AbstractSequentialList
add, addAll, get, iterator, remove, set
 
Methods inherited from class java.util.AbstractList
add, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

BreakTokenList

public BreakTokenList(BreakIterator breakIterator,
                      String text)
Constructs a BreakTokenList object.

Parameters:
breakIterator - base BreakIterator
text - base text
Throws:
NullPointerException - if any of the specified objects is null.
Method Detail

size

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

Specified by:
size in interface Collection<String>
Specified by:
size in interface List<String>
Specified by:
size in class AbstractCollection<String>
Returns:
the number of elements in this list

listIterator

public ListIterator<String> listIterator(int index)
Creates a list iterator based on the underlying break iterator.

Specified by:
listIterator in interface List<String>
Specified by:
listIterator in class AbstractSequentialList<String>
Parameters:
index - index of first element to be returned from the list iterator (by a call to the next method).
Returns:
a list iterator based on the underlying break iterator
Throws:
IndexOutOfBoundsException - if the index is out of range (index < 0 || index > size()).