it.unimi.dsi.lang
Class FlyweightPrototypes

java.lang.Object
  extended by it.unimi.dsi.lang.FlyweightPrototypes

public class FlyweightPrototypes
extends java.lang.Object

A class providing static methods and objects that do useful things with flyweight protoypes.


Constructor Summary
protected FlyweightPrototypes()
           
 
Method Summary
static
<T extends FlyweightPrototype<T>>
T
copy(T prototype)
          Creates a flyweight copy of the given object, or returns null if the given object is null.
static
<T extends FlyweightPrototype<T>>
T[]
copy(T[] prototype)
          Creates a flyweight copy of an array of flyweight prototypes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlyweightPrototypes

protected FlyweightPrototypes()
Method Detail

copy

public static <T extends FlyweightPrototype<T>> T[] copy(T[] prototype)
Creates a flyweight copy of an array of flyweight prototypes.

Type Parameters:
T - the type of FlyweightPrototype you want to copy, that is, the type of the elements of prototype.
Parameters:
prototype - an array of prototypes.
Returns:
a flyweight copy of prototype, obtained by invoking FlyweightPrototype.copy() on each element.

copy

public static <T extends FlyweightPrototype<T>> T copy(T prototype)
Creates a flyweight copy of the given object, or returns null if the given object is null.

Type Parameters:
T - the type of FlyweightPrototype you want to copy, that is, the type of prototype.
Parameters:
prototype - a prototype to be copied, or null.
Returns:
null, if prototype is null; otherwise,a flyweight copy of prototype.