OLD | NEW |
(Empty) | |
| 1 |
| 2 class _NamedNodeMapImpl extends _DOMTypeBase implements NamedNodeMap { |
| 3 _NamedNodeMapImpl._wrap(ptr) : super._wrap(ptr); |
| 4 |
| 5 int get length() => _wrap(_ptr.length); |
| 6 |
| 7 Node operator[](int index) => _wrap(_ptr[index]); |
| 8 |
| 9 |
| 10 void operator[]=(int index, Node value) { |
| 11 throw new UnsupportedOperationException("Cannot assign element of immutable
List."); |
| 12 } |
| 13 |
| 14 void add(Node value) { |
| 15 throw new UnsupportedOperationException("Cannot add to immutable List."); |
| 16 } |
| 17 |
| 18 void addLast(Node value) { |
| 19 throw new UnsupportedOperationException("Cannot add to immutable List."); |
| 20 } |
| 21 |
| 22 void addAll(Collection<Node> collection) { |
| 23 throw new UnsupportedOperationException("Cannot add to immutable List."); |
| 24 } |
| 25 |
| 26 void sort(int compare(Node a, Node b)) { |
| 27 throw new UnsupportedOperationException("Cannot sort immutable List."); |
| 28 } |
| 29 |
| 30 void copyFrom(List<Object> src, int srcStart, int dstStart, int count) { |
| 31 throw new UnsupportedOperationException("This object is immutable."); |
| 32 } |
| 33 |
| 34 int indexOf(Node element, [int start = 0]) { |
| 35 return _Lists.indexOf(this, element, start, this.length); |
| 36 } |
| 37 |
| 38 int lastIndexOf(Node element, [int start = null]) { |
| 39 if (start === null) start = length - 1; |
| 40 return _Lists.lastIndexOf(this, element, start); |
| 41 } |
| 42 |
| 43 int clear() { |
| 44 throw new UnsupportedOperationException("Cannot clear immutable List."); |
| 45 } |
| 46 |
| 47 Node removeLast() { |
| 48 throw new UnsupportedOperationException("Cannot removeLast on immutable List
."); |
| 49 } |
| 50 |
| 51 Node last() { |
| 52 return this[length - 1]; |
| 53 } |
| 54 |
| 55 void forEach(void f(Node element)) { |
| 56 _Collections.forEach(this, f); |
| 57 } |
| 58 |
| 59 Collection map(f(Node element)) { |
| 60 return _Collections.map(this, [], f); |
| 61 } |
| 62 |
| 63 Collection<Node> filter(bool f(Node element)) { |
| 64 return _Collections.filter(this, new List<Node>(), f); |
| 65 } |
| 66 |
| 67 bool every(bool f(Node element)) { |
| 68 return _Collections.every(this, f); |
| 69 } |
| 70 |
| 71 bool some(bool f(Node element)) { |
| 72 return _Collections.some(this, f); |
| 73 } |
| 74 |
| 75 void setRange(int start, int length, List<Node> from, [int startFrom]) { |
| 76 throw new UnsupportedOperationException("Cannot setRange on immutable List."
); |
| 77 } |
| 78 |
| 79 void removeRange(int start, int length) { |
| 80 throw new UnsupportedOperationException("Cannot removeRange on immutable Lis
t."); |
| 81 } |
| 82 |
| 83 void insertRange(int start, int length, [Node initialValue]) { |
| 84 throw new UnsupportedOperationException("Cannot insertRange on immutable Lis
t."); |
| 85 } |
| 86 |
| 87 List<Node> getRange(int start, int length) { |
| 88 throw new NotImplementedException(); |
| 89 } |
| 90 |
| 91 bool isEmpty() { |
| 92 return length == 0; |
| 93 } |
| 94 |
| 95 Iterator<Node> iterator() { |
| 96 return new _FixedSizeListIterator<Node>(this); |
| 97 } |
| 98 |
| 99 Node getNamedItem(String name) { |
| 100 return _wrap(_ptr.getNamedItem(_unwrap(name))); |
| 101 } |
| 102 |
| 103 Node getNamedItemNS(String namespaceURI, String localName) { |
| 104 return _wrap(_ptr.getNamedItemNS(_unwrap(namespaceURI), _unwrap(localName)))
; |
| 105 } |
| 106 |
| 107 Node item(int index) { |
| 108 return _wrap(_ptr.item(_unwrap(index))); |
| 109 } |
| 110 |
| 111 Node removeNamedItem(String name) { |
| 112 return _wrap(_ptr.removeNamedItem(_unwrap(name))); |
| 113 } |
| 114 |
| 115 Node removeNamedItemNS(String namespaceURI, String localName) { |
| 116 return _wrap(_ptr.removeNamedItemNS(_unwrap(namespaceURI), _unwrap(localName
))); |
| 117 } |
| 118 |
| 119 Node setNamedItem(Node node) { |
| 120 return _wrap(_ptr.setNamedItem(_unwrap(node))); |
| 121 } |
| 122 |
| 123 Node setNamedItemNS(Node node) { |
| 124 return _wrap(_ptr.setNamedItemNS(_unwrap(node))); |
| 125 } |
| 126 } |
OLD | NEW |