ma.glasnost.orika.util
Class SortedSet<V>
java.lang.Object
ma.glasnost.orika.util.SortedCollection<V>
ma.glasnost.orika.util.SortedSet<V>
- Type Parameters:
V - the element type
- All Implemented Interfaces:
- Iterable<V>, Collection<V>, Set<V>
public class SortedSet<V>
- extends SortedCollection<V>
- implements Set<V>
A sorted set implementation based on a Comparator (or type's natural ordering) where the
comparison function is allowed to return ordering equivalence (0)
which doesn't necessarily imply logical equivalence.
This allows for the ordering of a set of items where some are less or greater than
others, while others are simply not comparable in an ordering sense (in which case, 0 is
returned from their comparison).
This class is not thread-safe, with the same caveats for java.util.LinkedList.
- Author:
- matt.deboer@gmail.com
|
Method Summary |
boolean |
add(V value)
|
| Methods inherited from class ma.glasnost.orika.util.SortedCollection |
addAll, clear, contains, containsAll, first, insertBetween, isEmpty, iterator, last, remove, removeAll, retainAll, size, threadsafeCopy, toArray, toArray, toComparable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Set |
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
SortedSet
public SortedSet()
SortedSet
public SortedSet(Collection<? extends V> c)
- Parameters:
c - the collection to initialize this sorted set
SortedSet
public SortedSet(Comparator<V> comparator)
- Parameters:
comparator -
SortedSet
public SortedSet(Collection<? extends V> c,
Comparator<V> comparator)
- Parameters:
c - the collection to initialize this sorted setcomparator - the comparator used to sort this set
add
public boolean add(V value)
- Specified by:
add in interface Collection<V>- Specified by:
add in interface Set<V>- Overrides:
add in class SortedCollection<V>
Copyright © 2013 Glasnost. All Rights Reserved.