org.exolab.core.foundation
Interface TreeSetIfc

All Superinterfaces:
PersistentCapableIfc, java.io.Serializable
All Known Implementing Classes:
PMDTreeSet

public interface TreeSetIfc
extends PersistentCapableIfc, java.io.Serializable

This interface abstracts the Persistent TreeSet data structure so that it can be mapped to various persistent and transient datastores. It basically uses the JDK1.1.2 java.util.TreeSet to derive the interface. The interface extends PersistentCapableIfc and Serializable.

Version:
$Revision: 1.1 $ $Date: 2000/04/04 22:52:26 $
Author:
Jim Alateras
See Also:
PersistentCapableIfc, Serializable

Method Summary
 boolean add(java.lang.Object object)
          Adds the specified element to this set if it is not already present.If the element alsready exists then return false, otherwise return true.
 void clear()
          Removes all of the elements from this set.
 java.util.Comparator comparator()
          Returns the comparator used to order this set or null if this set uses natural ordering
 boolean contains(java.lang.Object object)
          Test whether the set contains the speciied object.If the object cannot be compared with other elements in the set the ClassCastException is raised.
 java.lang.Object first()
          Returns the first (lowest) key currently in this sorted set.It throws NoSuchElementException if the element does not exist.
 boolean isEmpty()
          Test is the set is empty
 java.util.Iterator iterator()
          Returns an iterator for the elements in this set.
 java.lang.Object last()
          Returns the last (highest) key currently in this sorted map.It throws NoSuchElementException if the element does not exist.
 boolean remove(java.lang.Object object)
          Removes the given element from this set if it is present.
 int size()
          Returns the number elements in the set
 
Methods inherited from interface org.exolab.core.foundation.PersistentCapableIfc
getMinimumObjectSize, getObjectId, getObjectVersion, setMinimumObjectSize
 

Method Detail

iterator

java.util.Iterator iterator()
Returns an iterator for the elements in this set. The elements are returned in ascending order.

Returns:
Iterator

size

int size()
Returns the number elements in the set

Returns:
number of mappings in this set

isEmpty

boolean isEmpty()
Test is the set is empty

Returns:
boolean true if the set is empty and false otherwise

contains

boolean contains(java.lang.Object object)
Test whether the set contains the speciied object.If the object cannot be compared with other elements in the set the ClassCastException is raised.

Parameters:
object - object to test for
Returns:
boolean true if present; false otherwise
Throws:
java.lang.ClassCastException

add

boolean add(java.lang.Object object)
Adds the specified element to this set if it is not already present.If the element alsready exists then return false, otherwise return true. If the specified object cannot be compared with other objects in the set it will throw the ClassCastException

Parameters:
object - object to add
Returns:
true if it was added and false otherwise
Throws:
java.lang.ClassCastException

remove

boolean remove(java.lang.Object object)
Removes the given element from this set if it is present. If the set contained the object return true otherwise return false. If the object cannot be compared with other elements in the set then throw the ClassCastException

Parameters:
object - object to remove
Returns:
boolean true if the object originally existed
Throws:
java.lang.ClassCastException

clear

void clear()
Removes all of the elements from this set.


comparator

java.util.Comparator comparator()
Returns the comparator used to order this set or null if this set uses natural ordering

Returns:
Comparator

first

java.lang.Object first()
Returns the first (lowest) key currently in this sorted set.It throws NoSuchElementException if the element does not exist.

Returns:
Object
Throws:
NoSuchElementException

last

java.lang.Object last()
Returns the last (highest) key currently in this sorted map.It throws NoSuchElementException if the element does not exist.

Returns:
Object
Throws:
NoSuchElementException


Copyright © 1999-2012 The Exolab Group. All Rights Reserved.