|
Oracle® Spatial Java API Reference 11g Release 2 (11.2) E11829-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.spatial.network.lod.LongHashSet
public class LongHashSet
This is a bare-bones, application specific, optimized hash set implementation. We feel this will perform better than the java.util.HashMap implementation for our application both in terms of execution time and memory usage. This is an UNSYNCHRONIZED IMPLEMENTATION!
Constructor Summary | |
---|---|
LongHashSet() Constructs a new, empty set; the backing HashMap instance has default initial capacity (16) and load factor (0.75). |
|
LongHashSet(java.util.Collection<java.lang.Long> c) Constructs a new set containing the elements in the specified collection. |
|
LongHashSet(int initialCapacity) Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and default load factor, which is 0.75. |
|
LongHashSet(int initialCapacity, float loadFactor) Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and the specified load factor. |
Method Summary | |
---|---|
boolean |
add(long o) Adds the specified element to this set if it is not already present. |
void |
clear() Removes all of the elements from this set. |
java.lang.Object |
clone() Returns a shallow copy of this HashSet instance: the elements themselves are not cloned. |
boolean |
contains(long o) Returns true if this set contains the specified element. |
boolean |
isEmpty() Returns true if this set contains no elements. |
boolean |
remove(long o) Removes the specified element from this set if it is present. |
int |
size() Returns the number of elements in this set (its cardinality). |
long[] |
toArray() Returns an array of the elements in this set. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LongHashSet()
public LongHashSet(java.util.Collection<java.lang.Long> c)
c
- the collection whose elements are to be placed into this set.java.lang.NullPointerException
- if the specified collection is null.public LongHashSet(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacity of the hash map.loadFactor
- the load factor of the hash map.java.lang.IllegalArgumentException
- if the initial capacity is less than zero, or if the load factor is nonpositive.public LongHashSet(int initialCapacity)
initialCapacity
- the initial capacity of the hash table.java.lang.IllegalArgumentException
- if the initial capacity is less than zero.Method Detail |
---|
public long[] toArray()
ConcurrentModificationException
public int size()
public boolean isEmpty()
public boolean contains(long o)
o
- element whose presence in this set is to be tested.public boolean add(long o)
o
- element to be added to this set.public boolean remove(long o)
o
- object to be removed from this set, if present.public void clear()
public java.lang.Object clone()
clone
in class java.lang.Object
|
Oracle® Spatial Java API Reference 11g Release 2 (11.2) E11829-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |