jfun.parsec

Class ArrayFactories

public final class ArrayFactories extends Object

Provide some standard ArrayFactory implementations.

Author: Ben Yu Nov 19, 2004

Method Summary
static ArrayFactory<Object>defaultFactory()
gets and instance of ArrayFactory that simply create Object[].
static <E> ArrayFactory<E>typedFactory(Class<E> etype)
gets and instanceof ArrayFactory that creates T[] for a given element type T.

Method Detail

defaultFactory

public static ArrayFactory<Object> defaultFactory()
gets and instance of ArrayFactory that simply create Object[].

Returns: the ArrayFactory instance.

typedFactory

public static <E> ArrayFactory<E> typedFactory(Class<E> etype)
gets and instanceof ArrayFactory that creates T[] for a given element type T.

Parameters: etype the element type.

Returns: the ArrayFactory instance.