Enum Class CompoundConstructor

java.lang.Object
java.lang.Enum<CompoundConstructor>
eu.bandm.tools.format.CompoundConstructor
All Implemented Interfaces:
Serializable, Comparable<CompoundConstructor>, java.lang.constant.Constable, Function<Collection<Format>,Format>

public enum CompoundConstructor extends Enum<CompoundConstructor> implements Function<Collection<Format>,Format>
Re-ification of the combination strategy applied by the different subclasses of Format.Compound for combining their sub-formats.
  • Enum Constant Details

  • Method Details

    • values

      public static CompoundConstructor[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CompoundConstructor valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • apply

      public abstract Format apply(Collection<Format> subs)
      Returns an instance of the correctly chosen sub-class of Format.Compound which corresponds to the combination method represented by the enumeration value. Goes via the factory methods, so it can return a singleton list content or an instance of Empty.
      Specified by:
      apply in interface Function<Collection<Format>,Format>
    • apply

      public abstract Format.Compound apply(int i, int a, boolean m, boolean g, int indent, List<Format> subs)
      Returns an instance of the correctly chosen sub-class of Format.Compound which corresponds to the combination method represented by the enumeration value.