com.neoworks.util
Class OneBlock

java.lang.Object
  |
  +--com.neoworks.util.OneBlock

public class OneBlock
extends java.lang.Object

A one argument function block. The value(Object) function should be overrided to provided the implementation of the function block. This will typicaly be done inline. e.g. new OneBlock() { public Object value(Object arg1) { return (((Boolean)arg1) == Boolean.TRUE) ? Boolean.FALSE : Boolean.TRUE } } The above trivial example is a OneBlock that takes an argument, casts it to a Boolean and returns the inverse of the argument. This function could be mapped over a collection of Booleans to produce the NOT of the collection.

Version:
$Revision: 1.4 $
Author:
Nicko Cadell nicko@neoworks.com

Field Summary
protected  java.lang.Object data
          Optional parametarised value
 
Constructor Summary
OneBlock()
          Default constructor
OneBlock(java.lang.Object value)
          Parametarised constructor.
 
Method Summary
 java.lang.Object value(java.lang.Object arg1)
          This function should be overriden by the implementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected java.lang.Object data
Optional parametarised value

Constructor Detail

OneBlock

public OneBlock()
Default constructor


OneBlock

public OneBlock(java.lang.Object value)
Parametarised constructor.

Parameters:
value - Value to paramatarise the OneBlock
Method Detail

value

public java.lang.Object value(java.lang.Object arg1)
This function should be overriden by the implementation

Parameters:
arg1 - The argument to the OneBlock
Returns:
the value to return