Package | org.as3collections |
Interface | public interface IListMap extends IMap, IIterable, org.as3coreaddendum.system.ICloneable, org.as3coreaddendum.system.IEquatable |
Implementors | AbstractListMap, TypedListMap |
The IListMap
interface provides the special IListMapIterator
iterator, that allows mapping insertion and replacement, and bidirectional access in addition to the normal operations that the IIterator
interface provides.
The listMapIterator()
method is provided to obtain a IListMapIterator
implementation that may start at a specified position in the map.
This interface has the purpose to, in certain degree, unify IList
and IMap
interfaces.
The methods that modify the map are specified to throw org.as3coreaddendum.errors.UnsupportedOperationError
if the map does not support the operation.
These methods are documented as "optional operation".
See also
Property | Defined By | ||
---|---|---|---|
allKeysEquatable : Boolean [read-only]
Indicates whether all keys in this map implements org.as3coreaddendum.system.IEquatable interface. | IMap | ||
allValuesEquatable : Boolean [read-only]
Indicates whether all values in this map implements org.as3coreaddendum.system.IEquatable interface. | IMap | ||
modCount : int [read-only]
The number of times this map has been structurally modified. | IListMap |
Method | Defined By | ||
---|---|---|---|
clear():void
Removes all of the mappings from this map (optional operation). | IMap | ||
containsKey(key:*):Boolean
Returns true if this map contains a mapping for the specified key. | IMap | ||
containsValue(value:*):Boolean
Returns true if this map maps one or more keys to the specified value. | IMap | ||
Returns an ICollection object that is a view of the mappings contained in this map. | IMap | ||
getKeyAt(index:int):*
Returns the key at the specified position in this map. | IListMap | ||
Returns an ICollection object that is a view of the keys contained in this map. | IMap | ||
getValue(key:*):*
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key. | IMap | ||
getValueAt(index:int):*
Returns the value at the specified position in this map. | IListMap | ||
Returns an ICollection object that is a view of the values contained in this map. | IMap | ||
Returns a new IListMap object that is a view of the portion of this map whose keys are strictly less than toKey. | IListMap | ||
indexOfKey(key:*):int
Returns the index of the first occurrence of the specified key in this map, or -1 if this map does not contain the key. | IListMap | ||
indexOfValue(value:*):int
Returns the index of the first occurrence of the specified value in this map, or -1 if this map does not contain the value. | IListMap | ||
isEmpty():Boolean
Returns true if this map contains no key-value mappings. | IMap | ||
Returns an iterator over a set of elements. | IIterable | ||
listMapIterator(index:int = 0):IListMapIterator
Returns a IListMapIterator object to iterate over the mappings in this map (in proper sequence), starting at the specified position in this map. | IListMap | ||
put(key:*, value:*):*
Associates the specified value with the specified key in this map (optional operation). | IMap | ||
Copies all of the mappings from the specified map to this map (optional operation). | IMap | ||
Copies all of the mappings from the specified map to this map (optional operation). | IListMap | ||
putAllByObject(o:Object):void
Retrieves each property of the specified object, calling put on this map once for each property (optional operation). | IMap | ||
putAt(index:int, key:*, value:*):void
Associates the specified value with the specified key at the specified position in this map (optional operation). | IListMap | ||
Associates the specified entry.value with the specified entry.key in this map (optional operation). | IMap | ||
remove(key:*):*
Removes the mapping for a key from this map if it is present (optional operation). | IMap | ||
removeAll(keys:ICollection):Boolean
Removes the mapping for a key from this map (if it is present) for each element in the specified collection (optional operation). | IMap | ||
Removes the mapping at the specified position in this map (optional operation). | IListMap | ||
removeRange(fromIndex:int, toIndex:int):IListMap
Removes all of the mappings whose index is between fromIndex, inclusive, and toIndex, exclusive (optional operation). | IListMap | ||
retainAll(keys:ICollection):Boolean
Retains only the mappings in this map that the keys are contained (as elements) in the specified collection (optional operation). | IMap | ||
reverse():void
Reverses the order of the mappings in this map. | IListMap | ||
setKeyAt(index:int, key:*):*
Replaces the key at the specified position in this map with the specified key (optional operation). | IListMap | ||
setValueAt(index:int, value:*):*
Replaces the value at the specified position in this map with the specified value (optional operation). | IListMap | ||
size():int
Returns the number of key-value mappings in this map. | IMap | ||
Returns a new IListMap object that is a view of the portion of this map between the specified fromIndex, inclusive, and toIndex, exclusive. | IListMap | ||
Returns a new IListMap object that is a view of the portion of this map whose keys are greater than or equal to fromKey. | IListMap |
modCount | property |
modCount:int
[read-only] The number of times this map has been structurally modified. Structural modifications are those that change the size of the map.
This field is used by the IListMapIterator
implementation returned by the listMapIterator
method.
If the value of this field changes unexpectedly, the IListMapIterator
object will throw a org.as3collections.errors.ConcurrentModificationError
in response to the next
, remove
, previous
or put
operations.
Implementations merely has to increment this field in its put
, remove
and any other methods that result in structural modifications to the map.
A single call to put
or remove
must add no more than one to this field.
public function get modCount():int
getKeyAt | () | method |
public function getKeyAt(index:int):*
Returns the key at the specified position in this map.
Parameters
index:int — index of the key to return.
|
* — the key at the specified position in this map.
|
IndexOutOfBoundsError — if the index is out of range (index < 0 || index >= size()) .
|
getValueAt | () | method |
public function getValueAt(index:int):*
Returns the value at the specified position in this map.
Parameters
index:int — index of the value to return.
|
* — the value at the specified position in this map.
|
IndexOutOfBoundsError — if the index is out of range (index < 0 || index >= size()) .
|
headMap | () | method |
public function headMap(toKey:*):IListMap
Returns a new IListMap
object that is a view of the portion of this map whose keys are strictly less than toKey
.
The returned map supports all optional map operations that this map supports.
Parameters
toKey:* — high endpoint (exclusive) of the keys in the returned map.
|
IListMap — a new IListMap that is a view of the portion of this map whose keys are strictly less than toKey .
|
ArgumentError — if toKey is null and this map does not permit null keys.
| |
ArgumentError — if containsKey(toKey) returns false .
|
indexOfKey | () | method |
public function indexOfKey(key:*):int
Returns the index of the first occurrence of the specified key in this map, or -1 if this map does not contain the key.
Parameters
key:* — the key to search for.
|
int — the index of the first occurrence of the specified key in this map, or -1 if this map does not contain the key.
|
org.as3coreaddendum.errors:ClassCastError — if the class of the specified key is incompatible with this map (optional).
| |
ArgumentError — if the specified key is null and this map does not permit null keys (optional).
|
indexOfValue | () | method |
public function indexOfValue(value:*):int
Returns the index of the first occurrence of the specified value in this map, or -1 if this map does not contain the value.
Parameters
value:* — the value to search for.
|
int — the index of the first occurrence of the specified value in this map, or -1 if this map does not contain the value.
|
org.as3coreaddendum.errors:ClassCastError — if the class of the specified value is incompatible with this map (optional).
| |
ArgumentError — if the specified value is null and this map does not permit null values (optional).
|
listMapIterator | () | method |
public function listMapIterator(index:int = 0):IListMapIterator
Returns a IListMapIterator
object to iterate over the mappings in this map (in proper sequence), starting at the specified position in this map.
The specified index indicates the first value that would be returned by an initial call to next
.
An initial call to previous
would return the value with the specified index minus one.
Parameters
index:int (default = 0 ) — index of first value to be returned from the iterator (by a call to the next method)
|
IListMapIterator — a IListMapIterator object to iterate over the mappings in this map (in proper sequence), starting at the specified position in this map.
|
putAllAt | () | method |
public function putAllAt(index:int, map:IMap):void
Copies all of the mappings from the specified map to this map (optional operation). Shifts the entry currently at that position (if any) and any subsequent entries to the right (increases their indices). The new entries will appear in this map in the order that they are returned by the specified map's iterator.
Parameters
index:int — index at which to insert the first entry from the specified map.
| |
map:IMap — mappings to be stored in this map.
|
org.as3coreaddendum.errors:UnsupportedOperationError — if the putAllAt operation is not supported by this map.
| |
org.as3coreaddendum.errors:ClassCastError — if the type of a key or value in the specified map is incompatible with this map.
| |
ArgumentError — if the specified map is null , or if this map does not permit null keys or values, and the specified map contains null keys or values.
| |
ArgumentError — if the specified map contains one or more keys already added in this map.
|
putAt | () | method |
public function putAt(index:int, key:*, value:*):void
Associates the specified value with the specified key at the specified position in this map (optional operation). Shifts the entry currently at that position (if any) and any subsequent entries to the right (adds one to their indices).
Parameters
index:int — index at which the specified entry is to be inserted.
| |
key:* — key with which the specified value is to be associated.
| |
value:* — value to be associated with the specified key.
|
org.as3coreaddendum.errors:UnsupportedOperationError — if the putAt operation is not supported by this map.
| |
org.as3coreaddendum.errors:ClassCastError — if the type of the specified key or value is incompatible with this map.
| |
ArgumentError — if the specified key or value is null and this map does not permit null keys or values.
| |
ArgumentError — if this map already contains the specified key.
| |
IndexOutOfBoundsError — if the index is out of range (index < 0 || index > size()) .
|
removeAt | () | method |
public function removeAt(index:int):IMapEntry
Removes the mapping at the specified position in this map (optional operation).
Shifts any subsequent mappings to the left (subtracts one from their indices).
Returns an IMapEntry
object containing the mapping (key/value) that was removed from the map.
Parameters
index:int — the index of the mapping to be removed.
|
IMapEntry — an IMapEntry object containing the mapping (key/value) that was removed from the map.
|
org.as3coreaddendum.errors:UnsupportedOperationError — if the removeAt operation is not supported by this map.
| |
IndexOutOfBoundsError — if the index is out of range (index < 0 || index >= size()) .
|
removeRange | () | method |
public function removeRange(fromIndex:int, toIndex:int):IListMap
Removes all of the mappings whose index is between fromIndex
, inclusive, and toIndex
, exclusive (optional operation).
Shifts any subsequent mappings to the left (subtracts their indices).
If toIndex == fromIndex
, this operation has no effect.
Parameters
fromIndex:int — the index to start removing mappings (inclusive).
| |
toIndex:int — the index to stop removing mappings (exclusive).
|
IListMap — a new map containing all the removed mappings.
|
org.as3coreaddendum.errors:UnsupportedOperationError — if the removeRange operation is not supported by this map.
| |
IndexOutOfBoundsError — if fromIndex or toIndex is out of range (index < 0 || index > size()) .
|
reverse | () | method |
public function reverse():void
Reverses the order of the mappings in this map.
setKeyAt | () | method |
public function setKeyAt(index:int, key:*):*
Replaces the key at the specified position in this map with the specified key (optional operation).
Parameters
index:int — index of the key to replace.
| |
key:* — key to be stored at the specified position.
|
* — the key previously at the specified position.
|
org.as3coreaddendum.errors:UnsupportedOperationError — if the setKeyAt operation is not supported by this map.
| |
org.as3coreaddendum.errors:ClassCastError — if the class of the specified key prevents it from being added to this map.
| |
ArgumentError — if the specified key is null and this map does not permit null keys.
| |
ArgumentError — if this map already contains the specified key.
| |
IndexOutOfBoundsError — if the index is out of range (index < 0 || index >= size()) .
|
setValueAt | () | method |
public function setValueAt(index:int, value:*):*
Replaces the value at the specified position in this map with the specified value (optional operation).
Parameters
index:int — index of the value to replace.
| |
value:* — value to be stored at the specified position.
|
* — the value previously at the specified position.
|
org.as3coreaddendum.errors:UnsupportedOperationError — if the setValueAt operation is not supported by this map.
| |
org.as3coreaddendum.errors:ClassCastError — if the class of the specified value prevents it from being added to this map.
| |
ArgumentError — if the specified value is null and this map does not permit null values.
| |
IndexOutOfBoundsError — if the index is out of range (index < 0 || index >= size()) .
|
subMap | () | method |
public function subMap(fromIndex:int, toIndex:int):IListMap
Returns a new IListMap
object that is a view of the portion of this map between the specified fromIndex
, inclusive, and toIndex
, exclusive.
The returned map supports all of the optional map operations supported by this map.
Parameters
fromIndex:int — the index to start retrieving mappings (inclusive).
| |
toIndex:int — the index to stop retrieving mappings (exclusive).
|
IListMap — a new map that is a view of the specified range within this map.
|
org.as3coreaddendum.errors:UnsupportedOperationError — if the subMap operation is not supported by this map.
| |
IndexOutOfBoundsError — if fromIndex or toIndex is out of range (index < 0 || index > size()) .
|
tailMap | () | method |
public function tailMap(fromKey:*):IListMap
Returns a new IListMap
object that is a view of the portion of this map whose keys are greater than or equal to fromKey
.
The returned map supports all optional map operations that this map supports.
Parameters
fromKey:* — low endpoint (inclusive) of the keys in the returned map.
|
IListMap — a new map that is a view of the portion of this map whose keys are greater than or equal to fromKey .
|
ArgumentError — if fromKey is null and this map does not permit null keys.
| |
ArgumentError — if containsKey(fromKey) returns false .
|