public class NodeSet<E> extends AbstractSet<E> implements Set<E>
This class is not a general-purpose Set implementation! While this class implements the Set interface, it intentionally violates Set's general contract, which mandates the use of the equals method when comparing objects.
This class is designed for use by SaccharideGraph so that multiple instances of the 'same' (i.e. two Glc) Monosaccharide can be used as nodes.
| Constructor and Description |
|---|
NodeSet(Collection<E> contents) |
NodeSet(int expectedMaxSize)
Constructs a new, empty set with the specified expected maximum size.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E e) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
static <N> NodeSet<N> |
of(N... nodes)
Create a new NodeSet that contains the
nodes |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
addAllpublic NodeSet(int expectedMaxSize)
expectedMaxSize - the expected maximum size of the setpublic NodeSet(Collection<E> contents)
public void clear()
clear in interface Collection<E>clear in interface Set<E>clear in class AbstractCollection<E>public int size()
size in interface Collection<E>size in interface Set<E>size in class AbstractCollection<E>public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface Set<E>isEmpty in class AbstractCollection<E>public boolean contains(Object o)
contains in interface Collection<E>contains in interface Set<E>contains in class AbstractCollection<E>public boolean remove(Object o)
remove in interface Collection<E>remove in interface Set<E>remove in class AbstractCollection<E>public boolean add(E e)
add in interface Collection<E>add in interface Set<E>add in class AbstractCollection<E>public Object[] toArray()
toArray in interface Collection<E>toArray in interface Set<E>toArray in class AbstractCollection<E>public <T> T[] toArray(T[] a)
toArray in interface Collection<E>toArray in interface Set<E>toArray in class AbstractCollection<E>public String toString()
toString in class AbstractCollection<E>public int hashCode()
hashCode in interface Collection<E>hashCode in interface Set<E>hashCode in class AbstractSet<E>public boolean equals(Object o)
equals in interface Collection<E>equals in interface Set<E>equals in class AbstractSet<E>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in interface Set<E>containsAll in class AbstractCollection<E>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in interface Set<E>removeAll in class AbstractSet<E>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<E>retainAll in interface Set<E>retainAll in class AbstractCollection<E>public static <N> NodeSet<N> of(N... nodes)
nodesN - the type of the nodenodes - the nodes to add to the node setnodesCopyright © 2016. All Rights Reserved.