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 Details

    • FlyweightPrototypes

      protected FlyweightPrototypes()
  • Method Details

    • 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.