TreeSet
Object Hierarchy:
Description:
public class TreeSet<G> :
AbstractSet<
G?>,
SortedSet<
G?>
Left-leaning red-black tree implementation of the Set interface.
This implementation is especially well designed for large quantity of data. The (balanced) tree implementation insure that the set and
get methods are in logarithmic complexity. For a linear implementation see HashSet
.
See also:
HashSet
Namespace: Gee
Package: gee-1.0
Content:
Creation methods:
Properties:
Methods:
-
public override bool
contains (G? item)
Determines whether this collection contains the specified item.
-
public override bool
add (G? item)
Adds an item to this collection. Must not be called on read-only collections.
-
public override bool
remove (G? item)
Removes the first occurence of an item from this collection. Must not be called on read-only
collections.
-
public override void
clear ()
Removes all items from this collection. Must not be called on read-only collections.
-
public override
Iterator<G?>
iterator ()
Returns a Iterator that can be used for
simple iteration over a collection.
-
public
BidirIterator<G?>
bidir_iterator ()
Returns a BidirIterator that can be
used for bi-directional iteration over this sorted set.
-
public G?
first ()
Returns the first element of the sorted set. Set must not be empty.
-
public G?
last ()
Returns the last element of the sorted set. Set must not be empty.
-
public
SortedSet<G?>
head_set (G? before)
Returns the sub-set of this sorted set containing elements strictly lower than the specified element.
-
public
SortedSet<G?>
tail_set (G? after)
Returns the sub-set of this sorted set containing elements equal or higher than the specified element.
-
public
SortedSet<G?>
sub_set (G? after,
G? before)
Returns the right-open sub-set of this sorted set, thus containing elements equal or higher than the
specified from element, and stricly lower than the specified to element.
-
public
BidirIterator<G?>?
iterator_at (G? item)
Returns a BidirIterator initialy
pointed at the specified element.
-
public G?
lower (G? item)
Returns the element which is strictly lower than the specified element.
-
public G?
higher (G? item)
Returns the element which is strictly higher than the specified element.
-
public G?
floor (G? item)
Returns the element which is lower or equal then the specified element.
-
public G?
ceil (G? item)
Returns the element which is higher or equal then the specified element.