Package it.unimi.dsi.lang
Class FlyweightPrototypes
java.lang.Object
it.unimi.dsi.lang.FlyweightPrototypes
A class providing static methods and objects that do useful things
with flyweight protoypes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <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.
-
Constructor Details
-
FlyweightPrototypes
protected FlyweightPrototypes()
-
-
Method Details
-
copy
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
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.
-