Packagecom.yworks.bridge.util
Classpublic class HashSet
InheritanceHashSet Inheritance AbstractSet Inheritance AbstractCollection Inheritance YObject Inheritance Object
Implements Set, Clonable

HashSet is an implementation of Set. All optional operations are supported, adding and removing. The elements can be any objects.



Public Properties
 PropertyDefined By
  empty : Boolean
[override] [read-only] Answers if this HashSet has no elements, a size of zero.
HashSet
  length : int
[override] [read-only] Answers the number of elements in this HashSet.
HashSet
Public Methods
 MethodDefined By
  
HashSet(init:Boolean = true)
Constructs a new empty instance of HashSet.
HashSet
 Inherited
addAll(collection:Collection):Boolean
Adds the objects in the specified Collection to this Collection.
AbstractCollection
  
addItem(object:Object):Boolean
[override] Adds the specified object to this HashSet.
HashSet
  
clear():void
[override] Removes all elements from this HashSet, leaving it empty.
HashSet
  
clone():Object
[override] Answers a new HashSet with the same elements and size as this HashSet.
HashSet
 Inherited
containsAll(collection:Collection):Boolean
Searches this Collection for all objects in the specified Collection.
AbstractCollection
  
containsItem(object:Object):Boolean
[override] Searches this HashSet for the specified object.
HashSet
 Inherited
equals(object:Object):Boolean
[override] Compares the specified object to this Set and answer if they are equal.
AbstractSet
  
getClass():Class
[override]
HashSet
 Inherited
hashCode():int
[override] Answers an integer hash code for the receiver.
AbstractSet
  
[override] Answers an Iterator on the elements of this HashSet.
HashSet
  
[static] Constructs a new empty instance of HashSet.
HashSet
  
newHashSet2(capacity:int):HashSet
[static] Constructs a new instance of HashSet with the specified capacity.
HashSet
  
[static] Constructs a new instance of HashSet containing the unique elements in the specified collection.
HashSet
  
newHashSet4(capacity:int, loadFactor:Number):HashSet
[static] Constructs a new instance of HashSet with the specified capacity and load factor.
HashSet
 Inherited
removeAll(collection:Collection):Boolean
[override] Removes all occurrences in this Collection of each object in the specified Collection.
AbstractSet
  
removeItem(object:Object):Boolean
[override] Removes an occurrence of the specified object from this HashSet.
HashSet
 Inherited
retainAll(collection:Collection):Boolean
Removes all objects from this Collection that are not contained in the specified Collection.
AbstractCollection
 Inherited
toArray():Vector.<Object>
Answers a new array containing all elements contained in this Collection.
AbstractCollection
 Inherited
toArray2(contents:Vector.<Object>):Vector.<Object>
Answers an array containing all elements contained in this Collection.
AbstractCollection
 Inherited
toString():String
Answers the string representation of this Collection.
AbstractCollection
Protected Methods
 MethodDefined By
  
cloneImpl(o:Object):void
[override]
HashSet
 Inherited
AbstractCollection
 Inherited
AbstractSet
  
Initializes this object.
HashSet
  
initHashSet2(capacity:int):void
Initializes this object.
HashSet
  
initHashSet3(collection:Collection):void
Initializes this object.
HashSet
  
initHashSet4(capacity:int, loadFactor:Number):void
Initializes this object.
HashSet
Property Detail
emptyproperty
empty:Boolean  [read-only] [override]

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


Implementation
    public function get empty():Boolean

See also

lengthproperty 
length:int  [read-only] [override]

Answers the number of elements in this HashSet.


Implementation
    public function get length():int
Constructor Detail
HashSet()Constructor
public function HashSet(init:Boolean = true)

Constructs a new empty instance of HashSet.

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
addItem()method
override public function addItem(object:Object):Boolean

Adds the specified object to this HashSet.

Parameters

object:Object — the object to add

Returns
Boolean — true when this HashSet did not already contain the object, false otherwise
clear()method 
override public function clear():void

Removes all elements from this HashSet, leaving it empty.

See also

clone()method 
override public function clone():Object

Answers a new HashSet with the same elements and size as this HashSet.

Returns
Object — a shallow copy of this HashSet

See also

cloneImpl()method 
override protected function cloneImpl(o:Object):void

Parameters

o:Object

containsItem()method 
override public function containsItem(object:Object):Boolean

Searches this HashSet for the specified object.

Parameters

object:Object — the object to search for

Returns
Boolean — true if object is an element of this HashSet, false otherwise
getClass()method 
override public function getClass():Class

Returns
Class
initHashSet1()method 
protected final function initHashSet1():void

Initializes this object. See the documentation of the corresponding factory method newHashSet1() for details.

See also

initHashSet2()method 
protected final function initHashSet2(capacity:int):void

Initializes this object. See the documentation of the corresponding factory method newHashSet2() for details.

Parameters

capacity:int

See also

initHashSet3()method 
protected final function initHashSet3(collection:Collection):void

Initializes this object. See the documentation of the corresponding factory method newHashSet3() for details.

Parameters

collection:Collection

See also

initHashSet4()method 
protected final function initHashSet4(capacity:int, loadFactor:Number):void

Initializes this object. See the documentation of the corresponding factory method newHashSet4() for details.

Parameters

capacity:int
 
loadFactor:Number

See also

iterator()method 
override public function iterator():Iterator

Answers an Iterator on the elements of this HashSet.

Returns
Iterator — an Iterator on the elements of this HashSet

See also

newHashSet1()method 
public static function newHashSet1():HashSet

Constructs a new empty instance of HashSet.

Returns
HashSet
newHashSet2()method 
public static function newHashSet2(capacity:int):HashSet

Constructs a new instance of HashSet with the specified capacity.

Parameters

capacity:int — the initial capacity of this HashSet

Returns
HashSet
newHashSet3()method 
public static function newHashSet3(collection:Collection):HashSet

Constructs a new instance of HashSet containing the unique elements in the specified collection.

Parameters

collection:Collection — the collection of elements to add

Returns
HashSet
newHashSet4()method 
public static function newHashSet4(capacity:int, loadFactor:Number):HashSet

Constructs a new instance of HashSet with the specified capacity and load factor.

Parameters

capacity:int — the initial capacity
 
loadFactor:Number — the initial load factor

Returns
HashSet
removeItem()method 
override public function removeItem(object:Object):Boolean

Removes an occurrence of the specified object from this HashSet.

Parameters

object:Object — the object to remove

Returns
Boolean — true if this HashSet is modified, false otherwise