org.ccnx.ccn.impl.support.TreeSet6< E > Class Reference

Add some missing features from the JDK 5 TreeSet. More...

Inherits java::util::TreeSet< E >.

List of all members.

Public Member Functions

 TreeSet6 (Comparator<?super E > c)
floorCompatible (E key)
 Returns the greatest element in this set less than or equal to the given element, or null if there is no such element.
ceilingCompatible (E key)
 Returns the least element in this set greater than or equal to the given element, or null if there is no such element.
lowerCompatible (E key)
 Returns the greatest element in this set strictly less than the given element, or null if there is no such element.
higherCompatible (E key)
 Returns the least element in this set strictly greater than the given element, or null if there is no such element.
Iterator< E > descendingIteratorCompatible ()
 Returns an iterator over the elements in this set in descending order.

Protected Member Functions

Method getMethod (Class<?> c, String name, Class<?>...parameterTypes)
 Our own wrapper for getMethod that returns null if the method is not found.
internalFloor (E key)
 Returns the greatest element in this set less than or equal to the given element, or null if there is no such element.
internalCeiling (E key)
 Returns the least element in this set greater than or equal to the given element, or null if there is no such element.
internalHigher (E key)
 Returns the least element in this set strictly greater than the given element, or null if there is no such element.
internalLower (E key)
 Returns the greatest element in this set strictly less than the given element, or null if there is no such element.
int mycompare (Comparator<?super E > comparator, Comparable<?super E > comparable, E a, E b) throws ClassCastException
 if comp not null, use comp, else use comparable if not null, else throw a ClassCast exception

Classes

class  DescendingIterator< T >


Detailed Description

Add some missing features from the JDK 5 TreeSet.

If running on JDK 6, use them as they will be way more efficient. This class is to provide JDK compatibility for the versioning package and only implements the needed functionality.

The user should call the *Compatible methods (floorCompatible, etc.) instead of the Java 6 methods (e.g. floor).

When used in a JDK 5 environment, the implementations of the provided algorithms is going to be O(N), not O(log N). There is no fast-fail detection for concurrent modifications. The descendingIterator works fine for iteration and calling remove(), but if you mix in other calls, like to add() while iterating, you will not see those values.


Member Function Documentation

E org.ccnx.ccn.impl.support.TreeSet6< E >.floorCompatible ( key  ) 

Returns the greatest element in this set less than or equal to the given element, or null if there is no such element.

Use this method, not floor().

E org.ccnx.ccn.impl.support.TreeSet6< E >.ceilingCompatible ( key  ) 

Returns the least element in this set greater than or equal to the given element, or null if there is no such element.

Use this method, not ceiling().

E org.ccnx.ccn.impl.support.TreeSet6< E >.lowerCompatible ( key  ) 

Returns the greatest element in this set strictly less than the given element, or null if there is no such element.

Use this method, not lower().

E org.ccnx.ccn.impl.support.TreeSet6< E >.higherCompatible ( key  ) 

Returns the least element in this set strictly greater than the given element, or null if there is no such element.

Use this method, not higher().

Iterator<E> org.ccnx.ccn.impl.support.TreeSet6< E >.descendingIteratorCompatible (  ) 

Returns an iterator over the elements in this set in descending order.

Returns:

Method org.ccnx.ccn.impl.support.TreeSet6< E >.getMethod ( Class<?>  c,
String  name,
Class<?>...  parameterTypes 
) [protected]

Our own wrapper for getMethod that returns null if the method is not found.

Parameters:
c class to search for method
name method name
parameterTypes 
Returns:
the method or null if not found

int org.ccnx.ccn.impl.support.TreeSet6< E >.mycompare ( Comparator<?super E >  comparator,
Comparable<?super E >  comparable,
a,
b 
) throws ClassCastException [protected]

if comp not null, use comp, else use comparable if not null, else throw a ClassCast exception

Parameters:
comparator the Comparator to use
comparable the casting to (Comparable) from a
a 
b 
Returns:
-1 if a<b, 0 a==0, +1 a>b


The documentation for this class was generated from the following file:

Generated on Thu Feb 16 00:45:00 2012 for Content-Centric Networking in Java by  doxygen 1.5.6