LinkedHashSet or TreeSetas the underlying
data structure.
LinkedHashSet
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final Set |
| Access | Constructor and Description |
|---|---|
| public | |
| public | NSSet(boolean
Indicates whether the created set should be ordered or unordered. ordered)Creates a new NSSet instance. |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | |
| public synchronized NSObject[] | |
| public synchronized NSObject | Returns: The first object in the set, ornull if the set is empty.Returns one of the objects in the set, or |
| pack-priv void | assignIDs(BinaryPropertyListWriter out)
Overrides com. Assigns IDs to all the objects in this NSObject subtree. |
| public NSSet | clone()
Implements abstract com. Creates and returns a deep copy of this instance. |
| public int | compareTo(NSObject o)
Implements java. Compares this object with the specified object for order. |
| public boolean | Returns: true, when the object was found, false otherwise.The object to look for. obj)Finds out whether the given object is contained in the set. |
| public synchronized int | |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public int | |
| public synchronized boolean | Returns: false if the intersection of both sets is empty, true otherwise.The other set. otherSet)Finds out whether at least one object is present in both sets. |
| public synchronized boolean | Returns: true if all elements in this set are also present in the other set, false otherwise.The other set. otherSet)Finds out if this set is a subset of the given set. |
| public synchronized NSObject | |
| public synchronized Iterator | Returns: The iterator for the set.Returns an iterator object that lets you iterate over all elements of the set. |
| public synchronized void | |
| protected void | toASCII(StringBuilder
The ASCII file string builder ascii, int The indentation level level)Implements abstract com. Returns the ASCII representation of this set. |
| protected void | toASCIIGnuStep(StringBuilder
The ASCII file string builder ascii, int The indentation level level)Implements abstract com. Returns the ASCII representation of this set according to the GnuStep format. |
| pack-priv void | toBinary(BinaryPropertyListWriter out)
Implements abstract com. Generates the binary representation of the object. |
| public Object | toJavaObject()
Implements abstract com. Converts this NSObject into an equivalent object of the Java Runtime Environment. |
| pack-priv void | toXML(StringBuilder
The XML StringBuilder xml, int The indentation level level)Implements abstract com. Returns the XML representation for this set. |
| ordered | back to summary |
|---|---|
| private boolean ordered | |
| set | back to summary |
|---|---|
| private final Set<NSObject> set | |
| NSSet | back to summary |
|---|---|
| public NSSet() Creates a new NSSet instance. The created set is unordered.
| |
| NSSet | back to summary |
|---|---|
| public NSSet(boolean ordered) Creates a new NSSet instance.
| |
| NSSet | back to summary |
|---|---|
| public NSSet(NSObject... objects) Creates a new NSSet instance with the specified content. The created set is unordered.
| |
| NSSet | back to summary |
|---|---|
| public NSSet(boolean ordered, NSObject... objects) Create a new NSSet instance with the specified content.
| |
| addObject | back to summary |
|---|---|
| public synchronized void addObject(NSObject obj) Adds an object to the set.
| |
| allObjects | back to summary |
|---|---|
| public synchronized NSObject[] allObjects() Returns all objects contained in the set.
| |
| anyObject | back to summary |
|---|---|
| public synchronized NSObject anyObject() Returns one of the objects in the set, or
| |
| assignIDs | back to summary |
|---|---|
| pack-priv void assignIDs(BinaryPropertyListWriter out) Overrides com. Doc from com. Assigns IDs to all the objects in this NSObject subtree.
| |
| clone | back to summary |
|---|---|
| public NSSet clone() Implements abstract com. Doc from com. Creates and returns a deep copy of this instance.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(NSObject o) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| containsObject | back to summary |
|---|---|
| public boolean containsObject(NSObject obj) Finds out whether the given object is contained in the set.
| |
| count | back to summary |
|---|---|
| public synchronized int count() Gets the number of elements in the set.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| intersectsSet | back to summary |
|---|---|
| public synchronized boolean intersectsSet(NSSet otherSet) Finds out whether at least one object is present in both sets.
| |
| isSubsetOfSet | back to summary |
|---|---|
| public synchronized boolean isSubsetOfSet(NSSet otherSet) Finds out if this set is a subset of the given set.
| |
| member | back to summary |
|---|---|
| public synchronized NSObject member(NSObject obj) Determines whether the set contains an object equal to the given object and returns that object if it is present. | |
| objectIterator | back to summary |
|---|---|
| public synchronized Iterator Returns an iterator object that lets you iterate over all elements of the set.
This is the equivalent to | |
| removeObject | back to summary |
|---|---|
| public synchronized void removeObject(NSObject obj) Removes an object from the set.
| |
| toASCII | back to summary |
|---|---|
| protected void toASCII(StringBuilder ascii, int level) Implements abstract com. Returns the ASCII representation of this set. There is no official ASCII representation for sets. In this implementation sets are represented as arrays.
| |
| toASCIIGnuStep | back to summary |
|---|---|
| protected void toASCIIGnuStep(StringBuilder ascii, int level) Implements abstract com. Returns the ASCII representation of this set according to the GnuStep format. There is no official ASCII representation for sets. In this implementation sets are represented as arrays.
| |
| toBinary | back to summary |
|---|---|
| pack-priv void toBinary(BinaryPropertyListWriter out) throws IOException Implements abstract com. Doc from com. Generates the binary representation of the object.
| |
| toJavaObject | back to summary |
|---|---|
| public Object toJavaObject() Implements abstract com. Doc from com. Converts this NSObject into an equivalent object of the Java Runtime Environment.
| |
| toXML | back to summary |
|---|---|
| pack-priv void toXML(StringBuilder xml, int level) Implements abstract com. Returns the XML representation for this set. There is no official XML representation specified for sets. In this implementation it is represented by an array.
| |