org.amino.alg.parallelprefix
Class DefaultAddBinaryOp<T>

java.lang.Object
  extended by org.amino.alg.parallelprefix.DefaultAddBinaryOp<T>
Type Parameters:
T - Non-primitive type of elements being manipulated.
All Implemented Interfaces:
BinaryOp<T>

public abstract class DefaultAddBinaryOp<T>
extends java.lang.Object
implements BinaryOp<T>

Provide basic implementation for addition binary operation used in parallel prefix package. For primitive data types, the parameterized type is ignored. The user must extend this class to do something intelligent with the non-primitive type

Author:
donawa
See Also:
ParallelPrefix

Constructor Summary
DefaultAddBinaryOp()
           
 
Method Summary
 byte transform(byte a, byte b)
          Transform two bytes to one.
 char transform(char a, char b)
          Transform two bytes to one.
 double transform(double a, double b)
          Transform two bytes to one.
 float transform(float a, float b)
          Transform two bytes to one.
 int transform(int a, int b)
          Transform two bytes to one.
 long transform(long a, long b)
          Transform two bytes to one.
 short transform(short a, short b)
          Transform two bytes to one.
 T transform(T a, T b)
          Transform two bytes to one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAddBinaryOp

public DefaultAddBinaryOp()
Method Detail

transform

public byte transform(byte a,
                      byte b)
Transform two bytes to one.

Specified by:
transform in interface BinaryOp<T>
Parameters:
a - op one
b - op two
Returns:
retsult

transform

public char transform(char a,
                      char b)
Transform two bytes to one.

Specified by:
transform in interface BinaryOp<T>
Parameters:
a - op one
b - op two
Returns:
retsult

transform

public short transform(short a,
                       short b)
Transform two bytes to one.

Specified by:
transform in interface BinaryOp<T>
Parameters:
a - op one
b - op two
Returns:
retsult

transform

public int transform(int a,
                     int b)
Transform two bytes to one.

Specified by:
transform in interface BinaryOp<T>
Parameters:
a - op one
b - op two
Returns:
retsult

transform

public long transform(long a,
                      long b)
Transform two bytes to one.

Specified by:
transform in interface BinaryOp<T>
Parameters:
a - op one
b - op two
Returns:
retsult

transform

public float transform(float a,
                       float b)
Transform two bytes to one.

Specified by:
transform in interface BinaryOp<T>
Parameters:
a - op one
b - op two
Returns:
retsult

transform

public double transform(double a,
                        double b)
Transform two bytes to one.

Specified by:
transform in interface BinaryOp<T>
Parameters:
a - op one
b - op two
Returns:
retsult

transform

public T transform(T a,
                   T b)
Transform two bytes to one.

Specified by:
transform in interface BinaryOp<T>
Parameters:
a - op one
b - op two
Returns:
retsult


Copyright © 2008. All Rights Reserved.