org.jvoicexml.xml
Class TokenList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<String>
          extended by org.jvoicexml.xml.TokenList
All Implemented Interfaces:
Iterable<String>, Collection<String>, List<String>

public final class TokenList
extends AbstractList<String>

Many of the tags feature lists of strings separated by a space. This class helps developers to create these lists easily and to iterate over them. This means real list access.

Version:
$Revision: 154 $

Copyright © 2005 JVoiceXML group - http://jvoicexml.sourceforge.net/

Author:
Dirk Schnelle

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
TokenList()
          Construct a new object.
TokenList(String stringlist)
          Create a new TokenList with values from the given list of strings separated by spaces.
 
Method Summary
 boolean add(String o)
           Adding null is not allowed and throws a NullPointerException.
 String get(int index)
          
 int size()
          
 String toString()
          
 
Methods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
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

TokenList

public TokenList()
Construct a new object.


TokenList

public TokenList(String stringlist)
Create a new TokenList with values from the given list of strings separated by spaces.

Parameters:
stringlist - List of strings separated by spaces.
Method Detail

get

public String get(int index)

Specified by:
get in interface List<String>
Specified by:
get in class AbstractList<String>

size

public int size()

Specified by:
size in interface Collection<String>
Specified by:
size in interface List<String>
Specified by:
size in class AbstractCollection<String>

toString

public String toString()

Overrides:
toString in class AbstractCollection<String>

add

public boolean add(String o)

Adding null is not allowed and throws a NullPointerException. Addition of an empty string has no effect on the list.

Specified by:
add in interface Collection<String>
Specified by:
add in interface List<String>
Overrides:
add in class AbstractList<String>
Returns:
true if the string was appendend.


Copyright © 2005-2007 JVoiceXML group.