Graphene Implementation 1.0.0.CR3

org.jboss.arquillian.ajocado.utils.array
Class ArrayTransform<S,T>

java.lang.Object
  extended by org.jboss.arquillian.ajocado.utils.array.ArrayTransform<S,T>
Type Parameters:
S - Type of source items.
T - Type of target items.

public abstract class ArrayTransform<S,T>
extends Object

Abstract class providing generic array transformations. Use overridden method transform(S[] sourceArray) to transform sourceArray to T[] targetArray. Method transform(S[] sourceArray) is implementation of transformation of each item from type S to type T. Items are transformed to target array as one-to-one preserving order of source.

Version:
$Revision$
Author:
Lukas Fryc

Constructor Summary
ArrayTransform(Class<T> tClass)
          Constructs ArrayTransform with implementation of transformation predefining tClass like a class of transformation-target array.
 
Method Summary
 T[] transform(S[] sourceArray)
          Process transformation of S[] sourceArray with T[] targetArray like return value.
abstract  T transformation(S source)
          This method is implementation of transformation each item of sourceArray and type S to item of type T in targetArray.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayTransform

public ArrayTransform(Class<T> tClass)
Constructs ArrayTransform with implementation of transformation predefining tClass like a class of transformation-target array.

Parameters:
tClass - class of type T in which should be typed resulting target array
Method Detail

transformation

public abstract T transformation(S source)
This method is implementation of transformation each item of sourceArray and type S to item of type T in targetArray.

Parameters:
source - transformation object
Returns:
transformation result

transform

public T[] transform(S[] sourceArray)
Process transformation of S[] sourceArray with T[] targetArray like return value.

Parameters:
sourceArray - array of type S which should be transformed to targetArray of type T
Returns:
targetArray of type T after transformation from S[] sourceArray

Graphene Implementation 1.0.0.CR3

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.