Class TFloatHashSetDecorator

  • All Implemented Interfaces:
    Iterable<Float>, Collection<Float>, Set<Float>


    public class TFloatHashSetDecorator
    extends AbstractSet<Float>
    implements Set<Float>
    Wrapper class to make a TFloatHashSet conform to the java.util.Set API. This class simply decorates an underlying TFloatHashSet and translates the Object-based APIs into their Trove primitive analogs.

    Note that wrapping and unwrapping primitive values is extremely inefficient. If possible, users of this class should override the appropriate methods in this class and use a table of canonical values.

    Created: Tue Sep 24 22:08:17 PDT 2002
    • Constructor Detail

      • TFloatHashSetDecorator

        public TFloatHashSetDecorator(TFloatHashSet set)
        Creates a wrapper that decorates the specified primitive set.
    • Method Detail

      • getSet

        public TFloatHashSet getSet()
        Returns a reference to the set wrapped by this decorator.
      • clone

        public TFloatHashSetDecorator clone()
        Clones the underlying trove collection and returns the clone wrapped in a new decorator instance. This is a shallow clone except where primitives are concerned.
        Overrides:
        clone in class  Object
        Returns:
        a copy of the receiver
      • equals

        public boolean equals(Object other)
        Compares this set with another set for equality of their stored entries.
        Specified by:
        equals in interface  Collection<Float>
        Specified by:
        equals in interface  Set<Float>
        Overrides:
        equals in class  AbstractSet<Float>
        Parameters:
        other - an Object value
        Returns:
        true if the sets are identical
      • clear

        public void clear()
        Empties the set.
      • wrap

        protected Float wrap(float k)
        Wraps a value
        Parameters:
        k - value in the underlying set
        Returns:
        an Object representation of the value
      • unwrap

        protected float unwrap(Object value)
        Unwraps a value
        Parameters:
        value - wrapped value
        Returns:
        an unwrapped representation of the value