Package it.unimi.dsi.lang
Class FlyweightPrototypes
- java.lang.Object
-
- it.unimi.dsi.lang.FlyweightPrototypes
-
public class FlyweightPrototypes extends Object
A class providing static methods and objects that do useful things with flyweight protoypes.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFlyweightPrototypes()
-
Method Summary
Modifier and Type Method Description static <T extends FlyweightPrototype<T>>
Tcopy(T prototype)Creates a flyweight copy of the given object, or returnsnullif the given object isnull.static <T extends FlyweightPrototype<T>>
T[]copy(T[] prototype)Creates a flyweight copy of an array of flyweight prototypes.
-
-
-
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 ofFlyweightPrototypeyou want to copy, that is, the type of the elements ofprototype.- Parameters:
prototype- an array of prototypes.- Returns:
- a flyweight copy of
prototype, obtained by invokingFlyweightPrototype.copy()on each element.
-
copy
public static <T extends FlyweightPrototype<T>> T copy(T prototype)
Creates a flyweight copy of the given object, or returnsnullif the given object isnull.- Type Parameters:
T- the type ofFlyweightPrototypeyou want to copy, that is, the type ofprototype.- Parameters:
prototype- a prototype to be copied, ornull.- Returns:
null, ifprototypeisnull; otherwise,a flyweight copy ofprototype.
-
-