Interface Composite<C extends Composite<C>>

Type Parameters:
C - The concrete type of the composite object.
All Superinterfaces:
Comparable<C>

public interface Composite<C extends Composite<C>> extends Comparable<C>
This interface provides adds methods to the standard methods defined in the java.lang.Comparable interface that are relevant to all composite objects. Since the java.lang.Cloneable interface is essentially broken it is not included and replaced with a parameterized copy() method.
Author:
Derk Norton
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends Composite<C>>
    T
    This method creates an exact copy of a composite.
    toString(String indentation)
    This method is an extension of the Object.toString() method that includes an indentation string that can be prepended to each line in a composite class that requires multiple lines for its formatted output.

    Methods inherited from interface java.lang.Comparable

    compareTo
  • Method Details

    • toString

      String toString(String indentation)
      This method is an extension of the Object.toString() method that includes an indentation string that can be prepended to each line in a composite class that requires multiple lines for its formatted output.
      Parameters:
      indentation - The string to be prepended to each line output.
      Returns:
      The formatted composite object.
    • copy

      <T extends Composite<C>> T copy()
      This method creates an exact copy of a composite.
      Type Parameters:
      T - The concrete type of the composite.
      Returns:
      An exact copy of the composite.