Package craterdog.core
Interface Composite<C extends Composite<C>>
- Type Parameters:
C
- The concrete type of the composite object.
- All Superinterfaces:
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 TypeMethodDescriptioncopy()
This method creates an exact copy of a composite.This method is an extension of theObject.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
This method is an extension of theObject.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
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.
-