Class SortedSetImpl

  • All Implemented Interfaces:
    Collection, Set, SortedSet

    public class SortedSetImpl
    extends Object
    implements SortedSet
    The LEAP (environment-dependent) implementation of the &qote;SortedSet&qote; interface. This class appears to be exactly the same in J2SE, PJAVA and MIDP. The internal implementation is different in the three cases however.
    Version:
    1.0, 20/10/00
    Author:
    Nicolas Lhuillier
    See Also:
    SortedSet, TreeSet
    • Constructor Detail

      • SortedSetImpl

        public SortedSetImpl()
        Default Constructor, creates an empty Set, according to the elements' natural order.
    • Method Detail

      • add

        public boolean add​(Object o)
        Description copied from interface: Collection
        Adds an element.
        Specified by:
        add in interface Collection
        Returns:
        true if the element has been added.
        See Also:
        interface
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: Collection
        Checks if the collection contains elements.
        Specified by:
        isEmpty in interface Collection
        Returns:
        true if this collection contains no elements
        See Also:
        interface
      • remove

        public boolean remove​(Object o)
        Description copied from interface: Collection
        Removes one instance of the specified element.
        Specified by:
        remove in interface Collection
        Parameters:
        o - the element to be removed
        Returns:
        true if the element has been removed
        See Also:
        interface
      • iterator

        public Iterator iterator()
        Description copied from interface: Collection
        Returns an iterator over the elements in this collection. There are no guarantees concerning the order in which the elements are returned.
        Specified by:
        iterator in interface Collection
        Returns:
        an Iterator over the elements in this collection
        See Also:
        interface
      • toArray

        public Object[] toArray()
        Description copied from interface: Collection
        Returns an array containing all of the elements in this collection.
        Specified by:
        toArray in interface Collection
        Returns:
        an array containing all of the elements in this collection
        See Also:
        interface
      • size

        public int size()
        Description copied from interface: Collection
        Returns the number of elements in this collection.
        Specified by:
        size in interface Collection
        Returns:
        the number of elements in this collection.
        See Also:
        interface
      • first

        public Object first()
        Description copied from interface: SortedSet
        Returns the first (lowest) element currently in this sorted set.
        Specified by:
        first in interface SortedSet
        Returns:
        the first (lowest) element currently in this sorted set.
        See Also:
        interface