Package | com.yworks.bridge.util |
Class | public class HashSet |
Inheritance | HashSet AbstractSet AbstractCollection YObject Object |
Implements | Set, Clonable |
Property | Defined 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 |
Method | Defined By | ||
---|---|---|---|
HashSet(init:Boolean = true)
Constructs a new empty instance of HashSet. | HashSet | ||
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 | ||
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 | ||
equals(object:Object):Boolean [override]
Compares the specified object to this Set and answer if they are equal. | AbstractSet | ||
getClass():Class [override] | HashSet | ||
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 | ||
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 | ||
retainAll(collection:Collection):Boolean
Removes all objects from this Collection that are not contained in the specified Collection. | AbstractCollection | ||
toArray():Vector.<Object>
Answers a new array containing all elements contained in this Collection. | AbstractCollection | ||
toArray2(contents:Vector.<Object>):Vector.<Object>
Answers an array containing all elements contained in this Collection. | AbstractCollection | ||
toString():String
Answers the string representation of this Collection. | AbstractCollection |
Method | Defined By | ||
---|---|---|---|
cloneImpl(o:Object):void [override] | HashSet | ||
initAbstractCollection():void | AbstractCollection | ||
initAbstractSet():void | AbstractSet | ||
initHashSet1():void
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 |
empty | property |
empty:Boolean
[read-only] [override] Answers if this HashSet has no elements, a size of zero.
public function get empty():Boolean
See also
length | property |
length:int
[read-only] [override] Answers the number of elements in this HashSet.
public function get length():int
HashSet | () | Constructor |
public function HashSet(init:Boolean = true)
Constructs a new empty instance of HashSet.
Parametersinit: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.
|
addItem | () | method |
override public function addItem(object:Object):Boolean
Adds the specified object to this HashSet.
Parameters
object:Object — the object to add
|
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.
ReturnsObject — 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
|
Boolean — true if object is an element of this HashSet, false otherwise
|
getClass | () | method |
override public function getClass():Class
ReturnsClass |
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.
ReturnsIterator — an Iterator on the elements of this HashSet
|
See also
newHashSet1 | () | method |
public static function newHashSet1():HashSet
Constructs a new empty instance of HashSet.
ReturnsHashSet |
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
|
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
|
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
|
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
|
Boolean — true if this HashSet is modified, false otherwise
|