org.vectomatic.dom.svg
Class OMSVGStringList

java.lang.Object
  extended by org.vectomatic.dom.svg.OMSVGStringList
All Implemented Interfaces:
Iterable<String>

public class OMSVGStringList
extends Object
implements Iterable<String>

This interface defines a list of DOMString values.

OMSVGStringList has the same attributes and methods as other SVGxxxList interfaces. Implementers may consider using a single base class to implement the various SVGxxxList interfaces.


Constructor Summary
protected OMSVGStringList(com.google.gwt.core.client.JavaScriptObject ot)
           
 
Method Summary
 String appendItem(String newItem)
          Inserts a new item at the end of the list.
 void clear()
          Clears all existing current items from the list, with the result being an empty list.
 String getItem(int index)
          Returns the specified item from the list.
 int getNumberOfItems()
          The number of items in the list.
 String initialize(String newItem)
          Clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter.
 String insertItemBefore(String newItem, int index)
          Inserts a new item into the list at the specified position.
 Iterator<String> iterator()
          Returns an iterator over the String elements in this list in proper sequence.
 String removeItem(int index)
          Removes an existing item from the list.
 String replaceItem(String newItem, int index)
          Replaces an existing item in the list with a new item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OMSVGStringList

protected OMSVGStringList(com.google.gwt.core.client.JavaScriptObject ot)
Method Detail

getNumberOfItems

public final int getNumberOfItems()
The number of items in the list.


clear

public final void clear()
                 throws com.google.gwt.core.client.JavaScriptException
Clears all existing current items from the list, with the result being an empty list.

Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the list cannot be modified.
com.google.gwt.core.client.JavaScriptException

initialize

public final String initialize(String newItem)
                        throws com.google.gwt.core.client.JavaScriptException
Clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter.

Parameters:
newItem - The item which should become the only member of the list.
Returns:
The item being inserted into the list.
Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the list cannot be modified.
com.google.gwt.core.client.JavaScriptException

getItem

public final String getItem(int index)
                     throws com.google.gwt.core.client.JavaScriptException
Returns the specified item from the list.

Parameters:
index - The index of the item from the list which is to be returned. The first item is number 0.
Returns:
The selected item.
Throws:
DOMException(INDEX_SIZE_ERR) - Raised if the index number is greater than or equal to getNumberOfItems().
com.google.gwt.core.client.JavaScriptException

insertItemBefore

public final String insertItemBefore(String newItem,
                                     int index)
                              throws com.google.gwt.core.client.JavaScriptException
Inserts a new item into the list at the specified position. The first item is number 0.

Parameters:
newItem - The item which is to be inserted into the list.
index - The index of the item before which the new item is to be inserted. The first item is number 0. If the index is equal to 0, then the new item is inserted at the front of the list. If the index is greater than or equal to getNumberOfItems(), then the new item is appended to the end of the list.
Returns:
The inserted item.
Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the list cannot be modified.
com.google.gwt.core.client.JavaScriptException

replaceItem

public final String replaceItem(String newItem,
                                int index)
                         throws com.google.gwt.core.client.JavaScriptException
Replaces an existing item in the list with a new item.

Parameters:
newItem - The item which is to be inserted into the list.
index - The index of the item which is to be replaced. The first item is number 0.
Returns:
The inserted item.
Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the list cannot be modified.
DOMException(INDEX_SIZE_ERR) - Raised if the index number is greater than or equal to getNumberOfItems().
com.google.gwt.core.client.JavaScriptException

removeItem

public final String removeItem(int index)
                        throws com.google.gwt.core.client.JavaScriptException
Removes an existing item from the list.

Parameters:
index - The index of the item which is to be removed. The first item is number 0.
Returns:
The removed item.
Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the list cannot be modified.
DOMException(INDEX_SIZE_ERR) - Raised if the index number is greater than or equal to getNumberOfItems().
com.google.gwt.core.client.JavaScriptException

appendItem

public final String appendItem(String newItem)
                        throws com.google.gwt.core.client.JavaScriptException
Inserts a new item at the end of the list.

Parameters:
newItem - The item which is to be inserted. The first item is number 0.
Returns:
The inserted item.
Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the list cannot be modified.
com.google.gwt.core.client.JavaScriptException

iterator

public final Iterator<String> iterator()
Returns an iterator over the String elements in this list in proper sequence.

This implementation returns a straightforward implementation of the iterator interface, relying on the backing list's getNumberOfItems(), and getItem(int) methods.

Note that the iterator returned by this method will throw an UnsupportedOperationException in response to its remove method.

Specified by:
iterator in interface Iterable<String>
Returns:
an iterator over the String elements in this list in proper sequence


Copyright © 2012. All Rights Reserved.