ariba.util.core
Class Function<K>

java.lang.Object
  extended by ariba.util.core.Function<K>

public abstract class Function<K>
extends Object

Generic class that represents a function returning a type K.


Constructor Summary
Function()
           
 
Method Summary
abstract  K evaluate(Object... arguments)
          Evaluates the supplied arguments returning an instance of type K.
 boolean hasSameValue(Collection elements)
          Returns true if each of the elements in elements has the same value according to this function.
<V> Map<K,List<V>>
split(Collection<V> collection)
          Efficiently, splits the supplied collection of a value type V returning a map which is a partition of the collection using this function.
<V> void
splitInto(Collection<V> collection, Map<K,List<V>> result)
          Efficiently, splits the supplied collection of a value type V returning a map which is a partition of the collection using this function.
<V> void
splitInto(Collection<V> collection, Map<K,List<V>> result, boolean includeNulls)
          Efficiently, splits the supplied collection of a value type V returning a map which is a partition of the collection using this function.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Function

public Function()
Method Detail

evaluate

public abstract K evaluate(Object... arguments)
Evaluates the supplied arguments returning an instance of type K.

Parameters:
arguments - the arguments to be evaulated
Returns:
the instance of K

hasSameValue

public boolean hasSameValue(Collection elements)
Returns true if each of the elements in elements has the same value according to this function.


splitInto

public <V> void splitInto(Collection<V> collection,
                          Map<K,List<V>> result,
                          boolean includeNulls)
Efficiently, splits the supplied collection of a value type V returning a map which is a partition of the collection using this function.

Specifically, this method splits collection into sub-lists each of which has the same value when evaluated by this function.


splitInto

public <V> void splitInto(Collection<V> collection,
                          Map<K,List<V>> result)
Efficiently, splits the supplied collection of a value type V returning a map which is a partition of the collection using this function.

Specifically, this method splits collection into sub-lists each of which has the same value when evaluated by this function.


split

public <V> Map<K,List<V>> split(Collection<V> collection)
Efficiently, splits the supplied collection of a value type V returning a map which is a partition of the collection using this function.

Specifically, this method splits collection into sub-lists each of which has the same value when evaluated by this function.



AribaWeb User Interface Development Framework
Copyright © 2000-2009 Ariba, Inc. All Rights Reserved.