|
14 | 14 |
|
15 | 15 | import org.w3c.dom.DOMException;
|
16 | 16 |
|
| 17 | +/** |
| 18 | + * A list of {@link SVGPoint} objects. |
| 19 | + */ |
17 | 20 | public interface SVGPointList {
|
| 21 | + |
| 22 | + /** |
| 23 | + * The number of items in the list. |
| 24 | + * |
| 25 | + * @return The number of items. |
| 26 | + */ |
18 | 27 | int getNumberOfItems();
|
19 | 28 |
|
| 29 | + /** |
| 30 | + * Clears all existing current items from the list, with the result being an |
| 31 | + * empty list. |
| 32 | + * |
| 33 | + * @throws DOMException NO_MODIFICATION_ALLOWED_ERR if this list is read only. |
| 34 | + */ |
20 | 35 | void clear() throws DOMException;
|
21 | 36 |
|
| 37 | + /** |
| 38 | + * Clear this list and add the given value to it. |
| 39 | + * |
| 40 | + * @param newItem the value. |
| 41 | + * @return the value. |
| 42 | + * @throws DOMException NO_MODIFICATION_ALLOWED_ERR if this list is read only. |
| 43 | + */ |
22 | 44 | SVGPoint initialize(SVGPoint newItem) throws DOMException, SVGException;
|
23 | 45 |
|
| 46 | + /** |
| 47 | + * Get the specified item from the list. |
| 48 | + * |
| 49 | + * @param index The index of the item from the list which is to be returned. The |
| 50 | + * first item is number 0. |
| 51 | + * @return the specified item from the list. |
| 52 | + * @throws DOMException INDEX_SIZE_ERR if the index number is greater than or |
| 53 | + * equal to numberOfItems. |
| 54 | + */ |
24 | 55 | SVGPoint getItem(int index) throws DOMException;
|
25 | 56 |
|
| 57 | + /** |
| 58 | + * Inserts a new item into the list at the specified position. |
| 59 | + * <p> |
| 60 | + * The first item is number 0. If newItem is already in a list, it is removed |
| 61 | + * from its previous list before it is inserted into this list. The inserted |
| 62 | + * item is the item itself and not a copy. If the item is already in this list, |
| 63 | + * note that the index of the item to insert before is before the removal of the |
| 64 | + * item. |
| 65 | + * </p> |
| 66 | + * |
| 67 | + * @param newItem The item which is to be inserted into the list. |
| 68 | + * @param index The index of the item before which the new item is to be |
| 69 | + * inserted. The first item is number 0. If the index is equal to |
| 70 | + * 0, then the new item is inserted at the front of the list. If |
| 71 | + * the index is greater than or equal to numberOfItems, then the |
| 72 | + * new item is appended to the end of the list. |
| 73 | + * @return The inserted item. |
| 74 | + * @throws DOMException NO_MODIFICATION_ALLOWED_ERR if this list is read only. |
| 75 | + */ |
26 | 76 | SVGPoint insertItemBefore(SVGPoint newItem, int index) throws DOMException, SVGException;
|
27 | 77 |
|
| 78 | + /** |
| 79 | + * Replaces an existing item in the list with a new item. |
| 80 | + * <p> |
| 81 | + * If newItem is already in a list, it is removed from its previous list before |
| 82 | + * it is inserted into this list. The inserted item is the item itself and not a |
| 83 | + * copy. If the item is already in this list, note that the index of the item to |
| 84 | + * replace is before the removal of the item. |
| 85 | + * </p> |
| 86 | + * |
| 87 | + * @param newItem The item which is to be inserted into the list. |
| 88 | + * @param index The index of the item which is to be replaced. The first item |
| 89 | + * is number 0. |
| 90 | + * @return The inserted item. |
| 91 | + * @throws DOMException NO_MODIFICATION_ALLOWED_ERR if this list is read only, |
| 92 | + * INDEX_SIZE_ERR if the index number is greater than or |
| 93 | + * equal to numberOfItems. |
| 94 | + */ |
28 | 95 | SVGPoint replaceItem(SVGPoint newItem, int index) throws DOMException, SVGException;
|
29 | 96 |
|
| 97 | + /** |
| 98 | + * Removes an existing item from the list. |
| 99 | + * |
| 100 | + * @param index The index of the item which is to be removed. The first item is |
| 101 | + * number 0. |
| 102 | + * @return The removed item. |
| 103 | + * @throws DOMException NO_MODIFICATION_ALLOWED_ERR if this list is read only, |
| 104 | + * INDEX_SIZE_ERR if the index number is greater than or |
| 105 | + * equal to numberOfItems. |
| 106 | + */ |
30 | 107 | SVGPoint removeItem(int index) throws DOMException;
|
31 | 108 |
|
| 109 | + /** |
| 110 | + * Inserts a new item at the end of the list. |
| 111 | + * <p> |
| 112 | + * If newItem is already in a list, it is removed from its previous list before |
| 113 | + * it is inserted into this list. The inserted item is the item itself and not a |
| 114 | + * copy. |
| 115 | + * </p> |
| 116 | + * |
| 117 | + * @param newItem The item which is to be appended. |
| 118 | + * @return the new item. |
| 119 | + * @throws DOMException NO_MODIFICATION_ALLOWED_ERR if this list is read only. |
| 120 | + */ |
32 | 121 | SVGPoint appendItem(SVGPoint newItem) throws DOMException, SVGException;
|
| 122 | + |
33 | 123 | }
|
0 commit comments