org.vectomatic.dom.svg
Class OMSVGNumberList

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

public class OMSVGNumberList
extends Object
implements Iterable<OMSVGNumber>

This interface defines a list of SVGNumber objects.

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

An OMSVGNumberList object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown, as described below.


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

Constructor Detail

OMSVGNumberList

protected OMSVGNumberList(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 corresponds to a read only attribute or when the object itself is read only.
com.google.gwt.core.client.JavaScriptException

initialize

public final OMSVGNumber initialize(OMSVGNumber 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. If the inserted item is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy.

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 corresponds to a read only attribute or when the object itself is read only.
com.google.gwt.core.client.JavaScriptException

getItem

public final OMSVGNumber getItem(int index)
                          throws com.google.gwt.core.client.JavaScriptException
Returns the specified item from the list. The returned item is the item itself and not a copy. Any changes made to the item are immediately reflected in 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 OMSVGNumber insertItemBefore(OMSVGNumber 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. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to insert before is before the removal of the item.

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 corresponds to a read only attribute or when the object itself is read only.
com.google.gwt.core.client.JavaScriptException

replaceItem

public final OMSVGNumber replaceItem(OMSVGNumber newItem,
                                     int index)
                              throws com.google.gwt.core.client.JavaScriptException
Replaces an existing item in the list with a new item. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to replace is before the removal of the 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 corresponds to a read only attribute or when the object itself is read only.
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 OMSVGNumber 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 OMSVGNumber appendItem(OMSVGNumber newItem)
                             throws com.google.gwt.core.client.JavaScriptException
Inserts a new item at the end of the list. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy.

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

insertItemBefore

public final OMSVGNumber insertItemBefore(OMSVGSVGElement svg,
                                          float value,
                                          int index)
                                   throws com.google.gwt.core.client.JavaScriptException
Inserts a new value into the list at the specified position. The first value is number 0. The value is wrapped into a OMSVGNumber

Parameters:
svg - The OMSVGSVGElement used to instantiate the float wrapper.
value - The value which is to be inserted into the list.
index - The index of the value before which the new value is to be inserted. The first value is number 0. If the index is equal to 0, then the new value is inserted at the front of the list. If the index is greater than or equal to getNumberOfItems(), then the new value is appended to the end of the list.
Returns:
The inserted value wrapper.
Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the list corresponds to a read only attribute or when the object itself is read only.
com.google.gwt.core.client.JavaScriptException

appendItem

public final OMSVGNumber appendItem(OMSVGSVGElement svg,
                                    float value)
                             throws com.google.gwt.core.client.JavaScriptException
Inserts a new value at the end of the list. The value is wrapped into a OMSVGNumber

Parameters:
svg - The OMSVGSVGElement used to instantiate the float wrapper.
value - The value which is to be inserted. The first value is number 0.
Returns:
The inserted value wrapper.
Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the list cannot be modified.
com.google.gwt.core.client.JavaScriptException

appendItems

public final OMSVGNumber[] appendItems(OMSVGSVGElement svg,
                                       float[] values)
                                throws com.google.gwt.core.client.JavaScriptException
Inserts an array of values at the end of the list. The values are wrapped into OMSVGNumber objects

Parameters:
svg - The OMSVGSVGElement used to instantiate the float wrappers.
values - The array of values which is to be inserted. The first value is number 0.
Returns:
The array of inserted value wrappers.
Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the list cannot be modified.
com.google.gwt.core.client.JavaScriptException

replaceItem

public final OMSVGNumber replaceItem(OMSVGSVGElement svg,
                                     float value,
                                     int index)
                              throws com.google.gwt.core.client.JavaScriptException
Replaces an existing value in the list with a new value. The new value is wrapped into a OMSVGNumber. If value is already in a list, it is removed from its previous list before it is inserted into this list.

Parameters:
svg - The OMSVGSVGElement used to instantiate the float wrapper.
value - The value which is to be inserted into the list.
index - The index of the value which is to be replaced. The first item is number 0.
Returns:
The inserted value wrapper.
Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the list corresponds to a read only attribute or when the object itself is read only.
DOMException(INDEX_SIZE_ERR) - Raised if the index number is greater than or equal to getNumberOfItems().
com.google.gwt.core.client.JavaScriptException

iterator

public final Iterator<OMSVGNumber> iterator()
Returns an iterator over the OMSVGNumber 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<OMSVGNumber>
Returns:
an iterator over the OMSVGNumber elements in this list in proper sequence


Copyright © 2012. All Rights Reserved.