Packagecom.yworks.bridge.util
Classpublic class AbstractMap
InheritanceAbstractMap Inheritance YObject Inheritance Object
Implements Map
Subclasses HashMap, TreeMap

AbstractMap is an abstract implementation of the Map interface. This implementation does not support adding. A subclass must implement the abstract method entrySet().



Public Properties
 PropertyDefined By
  empty : Boolean
[read-only] Answers if this Map has no elements, a size of zero.
AbstractMap
Public Methods
 MethodDefined By
  
AbstractMap(init:Boolean = true)
Constructs a new instance of this AbstractMap.
AbstractMap
  
clear():void
Removes all elements from this Map, leaving it empty.
AbstractMap
  
clone():Object
Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
AbstractMap
  
containsKey(key:Object):Boolean
Searches this Map for the specified key.
AbstractMap
  
containsValue(value:Object):Boolean
Searches this Map for the specified value.
AbstractMap
  
Returns a Set of Map.Entrys that represent the entries in this Map.
AbstractMap
  
equals(object:Object):Boolean
[override] Compares the specified object to this Map and answer if they are equal.
AbstractMap
  
getClass():Class
[override]
AbstractMap
  
getValue(key:Object):Object
Answers the value of the mapping with the specified key.
AbstractMap
  
hashCode():int
[override] Answers an integer hash code for the receiver.
AbstractMap
  
Answers a Set of the keys contained in this Map.
AbstractMap
  
putAll(map:Map):void
Copies every mapping in the specified Map to this Map.
AbstractMap
  
putValue(key:Object, value:Object):Object
Maps the specified key to the specified value.
AbstractMap
  
remove(key:Object):Object
Removes a mapping with the specified key from this Map.
AbstractMap
  
size():int
Answers the number of elements in this Map.
AbstractMap
  
toString():String
Answers the string representation of this Map.
AbstractMap
  
Answers a collection of the values contained in this map.
AbstractMap
Protected Methods
 MethodDefined By
  
cloneImpl(o:Object):void
AbstractMap
  
AbstractMap
Property Detail
emptyproperty
empty:Boolean  [read-only]

Answers if this Map has no elements, a size of zero.


Implementation
    public function get empty():Boolean

See also

Constructor Detail
AbstractMap()Constructor
public function AbstractMap(init:Boolean = true)

Constructs a new instance of this AbstractMap.

Parameters
init:Boolean (default = true) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods. This parameter can safely be ignored/omitted when calling the constructor.
Method Detail
clear()method
public function clear():void

Removes all elements from this Map, leaving it empty.


Throws
flash.errors:IllegalOperationError — when removing from this Map is not supported

See also

clone()method 
public function clone():Object

Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.

Returns
Object — Object a shallow copy of this object.

Throws
CloneNotSupportedException — if the receiver's class does not implement the interface Cloneable.
cloneImpl()method 
protected function cloneImpl(o:Object):void

Parameters

o:Object

containsKey()method 
public function containsKey(key:Object):Boolean

Searches this Map for the specified key.

Parameters

key:Object — the object to search for

Returns
Boolean — true if key is a key of this Map, false otherwise
containsValue()method 
public function containsValue(value:Object):Boolean

Searches this Map for the specified value.

Parameters

value:Object — the object to search for

Returns
Boolean — true if value is a value of this Map, false otherwise
entrySet()method 
public function entrySet():Set

Returns a Set of Map.Entrys that represent the entries in this Map. Making changes to this Set will change the original Map and vice-versa. Entries can be removed from the Set, or their values can be changed, but new entries cannot be added to the Set.

Returns
Set — a Set of Map.Entrys representing the entries in this Map
equals()method 
override public function equals(object:Object):Boolean

Compares the specified object to this Map and answer if they are equal. The object must be an instance of Map and contain the same key/value pairs.

Parameters

object:Object — the object to compare with this object

Returns
Boolean — true if the specified object is equal to this Map, false otherwise

See also

getClass()method 
override public function getClass():Class

Returns
Class
getValue()method 
public function getValue(key:Object):Object

Answers the value of the mapping with the specified key.

Parameters

key:Object — the key

Returns
Object — the value of the mapping with the specified key
hashCode()method 
override public function hashCode():int

Answers an integer hash code for the receiver. Objects which are equal answer the same value for this method.

Returns
int — the receiver's hash

See also

initAbstractMap()method 
protected final function initAbstractMap():void

keySet()method 
public function keySet():Set

Answers a Set of the keys contained in this Map. The set is backed by this Map so changes to one are reflected by the other. The set does not support adding.

Returns
Set — a Set of the keys
putAll()method 
public function putAll(map:Map):void

Copies every mapping in the specified Map to this Map.

Parameters

map:Map — the Map to copy mappings from


Throws
flash.errors:IllegalOperationError — when adding to this Map is not supported
 
TypeError — when the class of a key or value is inappropriate for this Map
 
IllegalArgumentException — when a key or value cannot be added to this Map
 
ReferenceError — when a key or value is null and this Map does not support null keys or values
putValue()method 
public function putValue(key:Object, value:Object):Object

Maps the specified key to the specified value.

Parameters

key:Object — the key
 
value:Object — the value

Returns
Object — the value of any previous mapping with the specified key or null if there was no mapping

Throws
flash.errors:IllegalOperationError — when adding to this Map is not supported
 
TypeError — when the class of the key or value is inappropriate for this Map
 
IllegalArgumentException — when the key or value cannot be added to this Map
 
ReferenceError — when the key or value is null and this Map does not support null keys or values
remove()method 
public function remove(key:Object):Object

Removes a mapping with the specified key from this Map.

Parameters

key:Object — the key of the mapping to remove

Returns
Object — the value of the removed mapping or null if key is not a key in this Map

Throws
flash.errors:IllegalOperationError — when removing from this Map is not supported
size()method 
public function size():int

Answers the number of elements in this Map.

Returns
int — the number of elements in this Map
toString()method 
public function toString():String

Answers the string representation of this Map.

Returns
String — the string representation of this Map
values()method 
public function values():Collection

Answers a collection of the values contained in this map. The collection is backed by this map so changes to one are reflected by the other. The collection supports remove, removeAll, retainAll and clear operations, and it does not support add or addAll operations. This method answers a collection which is the subclass of AbstractCollection. The iterator method of this subclass answers a "wrapper object" over the iterator of map's entrySet(). The size method wraps the map's size method and the contains method wraps the map's containsValue method. The collection is created when this method is called at first time and returned in response to all subsequent calls. This method may return different Collection when multiple calls to this method, since it has no synchronization performed.

Returns
Collection — a collection of the values contained in this map