org.planx.msd.array
Class ShortArrayDiscriminator

java.lang.Object
  extended by org.planx.msd.util.AbstractDiscriminator<short[]>
      extended by org.planx.msd.array.ShortArrayDiscriminator
All Implemented Interfaces:
Discriminator<short[]>

public class ShortArrayDiscriminator
extends AbstractDiscriminator<short[]>

A Discriminator capable of discriminating a multiset of arrays of shorts.

Note that this implementation is not synchronized. If multiple threads access an instance of this class concurrently, it must be synchronized externally.

Author:
Thomas Ambus

Constructor Summary
ShortArrayDiscriminator(Memory memory)
          Constructs a new ShortArrayDiscriminator reusing the memory allocated in the specified Memory.
 
Method Summary
<U,S> Collection<List<S>>
discriminate(List<? extends U> values, Extractor<U,? extends short[],S> e)
          Discriminates a List of values using an Extractor, and returns a Collection of Lists, each representing an equivalence class containing elements from values that are equivalent.
 
Methods inherited from class org.planx.msd.util.AbstractDiscriminator
discriminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShortArrayDiscriminator

public ShortArrayDiscriminator(Memory memory)
Constructs a new ShortArrayDiscriminator reusing the memory allocated in the specified Memory.

Method Detail

discriminate

public <U,S> Collection<List<S>> discriminate(List<? extends U> values,
                                              Extractor<U,? extends short[],S> e)
Description copied from interface: Discriminator
Discriminates a List of values using an Extractor, and returns a Collection of Lists, each representing an equivalence class containing elements from values that are equivalent. The Extractor performs the task of extracting two kinds of objects from the input values: The label which is the object equivalence is defined upon, and the value which is the object that will be returned. That is, the label determines which equivalence class the value goes into.

The Collection of Lists returned should be considered unmodifiable (though, in some cases they might actually be modifiable, but this behaviour should not be relied upon).

Specified by:
discriminate in interface Discriminator<short[]>
Specified by:
discriminate in class AbstractDiscriminator<short[]>


Copyright © 2010. All Rights Reserved.