E - The type of element managed by this collection.public abstract class OrderedCollection<E> extends Collection<E> implements Ordered<E>
Comparator. If no comparator is specified, the
elements extend the Comparable interface.| Modifier | Constructor and Description |
|---|---|
protected |
OrderedCollection(boolean duplicatesAllowed)
This constructor creates a new empty collection with no comparator function.
|
protected |
OrderedCollection(boolean duplicatesAllowed,
java.util.Comparator<? super E> comparator)
This constructor creates a new collection with the specified comparator function.
|
protected |
OrderedCollection(E[] elements,
boolean duplicatesAllowed)
This constructor creates a new collection with no comparator function and seeds
it with the elements from the specified array.
|
protected |
OrderedCollection(E[] elements,
boolean duplicatesAllowed,
java.util.Comparator<? super E> comparator)
This constructor creates a new collection with the specified comparator function and seeds
it with the elements from the specified array.
|
protected |
OrderedCollection(java.lang.Iterable<? extends E> elements,
boolean duplicatesAllowed)
This constructor creates a new collection with no comparator function and seeds
it with the elements from the specified collection.
|
protected |
OrderedCollection(java.lang.Iterable<? extends E> elements,
boolean duplicatesAllowed,
java.util.Comparator<? super E> comparator)
This constructor creates a new collection with the specified comparator function and seeds
it with the elements from the specified collection.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addElement(E element)
This method adds a new element to the collection.
|
boolean |
containsElement(E element)
This method determines if an element is contained in the collection.
|
Iterator<E> |
createDefaultIterator()
This method creates a new default iterator for the collection.
|
int |
getNumberOfElements() |
void |
removeAllElements()
This method removes all elements from the collection.
|
boolean |
removeElement(E element)
This method removes the specified element from the collection.
|
addElements, addElements, containsAllElementsIn, containsAnyElementsIn, equals, hashCode, isEmpty, iterator, normalizedIndex, removeElements, removeElements, toArray, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitisEmpty, iterator, toArrayprotected OrderedCollection(boolean duplicatesAllowed)
duplicatesAllowed - Whether or not duplicate elements are allowed.protected OrderedCollection(E[] elements, boolean duplicatesAllowed)
elements - The elements to be used to seed the new collection.duplicatesAllowed - Whether or not duplicate elements are allowed.protected OrderedCollection(java.lang.Iterable<? extends E> elements, boolean duplicatesAllowed)
elements - The elements to be used to seed the new collection.duplicatesAllowed - Whether or not duplicate elements are allowed.protected OrderedCollection(boolean duplicatesAllowed,
java.util.Comparator<? super E> comparator)
duplicatesAllowed - Whether or not duplicate elements are allowed.comparator - The comparator to be used to compare two elements during ordering.protected OrderedCollection(E[] elements, boolean duplicatesAllowed, java.util.Comparator<? super E> comparator)
elements - The elements to be used to seed the new collection.duplicatesAllowed - Whether or not duplicate elements are allowed.comparator - The comparator to be used to compare two elements during ordering.protected OrderedCollection(java.lang.Iterable<? extends E> elements, boolean duplicatesAllowed, java.util.Comparator<? super E> comparator)
elements - The elements to be used to seed the new collection.duplicatesAllowed - Whether or not duplicate elements are allowed.comparator - The comparator to be used to compare two elements during ordering.public final int getNumberOfElements()
getNumberOfElements in interface Sequential<E>public final boolean containsElement(E element)
AccessiblecontainsElement in interface Accessible<E>element - The element to be checked for in the collection.public final Iterator<E> createDefaultIterator()
IteratablecreateDefaultIterator in interface Iteratable<E>public final boolean addElement(E element)
AccessibleaddElement in interface Accessible<E>element - The new element to be added.public final boolean removeElement(E element)
AccessibleremoveElement in interface Accessible<E>element - The element to be removed.public final void removeAllElements()
IteratableremoveAllElements in interface Iteratable<E>Copyright © 2014 Crater Dog Technologies(TM). All rights reserved.