Package output
Class OutputCommutative
Object
OutputCommutative
- All Implemented Interfaces:
OutputFunction
public class OutputCommutative extends Object implements OutputFunction
Provides a parent class for all
OutputFunctions of any number of commutative arguments-
Field Summary
Fields Modifier and Type Field Description protected StringfunctionNameThe name of the functionprotected Collector<CharSequence,?,String>latexJoiningCollectorACollectorfor generating outputLaTeXstringsprotected Collector<CharSequence,?,String>normalJoiningCollectorACollectorfor generating output text stringsprotected List<OutputFunction>operandsThe operands of the function -
Constructor Summary
Constructors Constructor Description OutputCommutative(String functionName, List<OutputFunction> operands)Returns a newOutputUnitaryfunctionOutputCommutative(String functionName, List<OutputFunction> operands, Collector<CharSequence,?,String> normalJoiningCollector, Collector<CharSequence,?,String> latexJoiningCollector)Returns a newOutputUnitaryfunctionOutputCommutative(String functionName, OutputFunction... operands)Returns a newOutputUnitaryfunction -
Method Summary
Modifier and Type Method Description booleanequals(Object that)Checks if thisOutputFunctionis equal tothatStringgetName()Returns the name of this functionCollection<OutputFunction>getOperands()Returns the operands of this function (its children in the function tree)inthashCode()Returns a hash code value for this objectStringtoLatex()Returns aLaTeXrepresentation of the function treeStringtoString()Returns a text representation of the function tree
-
Field Details
-
functionName
protected final String functionNameThe name of the function -
normalJoiningCollector
protected final Collector<CharSequence,?,String> normalJoiningCollectorACollectorfor generating output text strings -
latexJoiningCollector
protected final Collector<CharSequence,?,String> latexJoiningCollectorACollectorfor generating outputLaTeXstrings -
operands
The operands of the function
-
-
Constructor Details
-
OutputCommutative
public OutputCommutative(String functionName, List<OutputFunction> operands, Collector<CharSequence,?,String> normalJoiningCollector, Collector<CharSequence,?,String> latexJoiningCollector)Returns a newOutputUnitaryfunction- Parameters:
functionName- the name of the functionoperands- the operands of the functionnormalJoiningCollector- the joining collector for basictoString()latexJoiningCollector- the joining collector fortoLatex()
-
OutputCommutative
Returns a newOutputUnitaryfunction- Parameters:
functionName- the name of the functionoperands- the operands of the function
-
OutputCommutative
Returns a newOutputUnitaryfunction- Parameters:
functionName- the name of the functionoperands- the operands of the function
-
-
Method Details
-
getName
public String getName()Description copied from interface:OutputFunctionReturns the name of this function- Specified by:
getNamein interfaceOutputFunction- Returns:
- the name of this function
-
getOperands
Description copied from interface:OutputFunctionReturns the operands of this function (its children in the function tree)- Specified by:
getOperandsin interfaceOutputFunction- Returns:
- a collection of operands
-
toString
public String toString()Description copied from interface:OutputFunctionReturns a text representation of the function tree- Specified by:
toStringin interfaceOutputFunction- Overrides:
toStringin classObject- Returns:
- a text representation of the function tree
-
toLatex
public String toLatex()Description copied from interface:OutputFunctionReturns aLaTeXrepresentation of the function tree- Specified by:
toLatexin interfaceOutputFunction- Returns:
- a
LaTeXrepresentation of the function tree
-
equals
public boolean equals(Object that)Description copied from interface:OutputFunctionChecks if thisOutputFunctionis equal tothat- Specified by:
equalsin interfaceOutputFunction- Overrides:
equalsin classObject- Parameters:
that- the object to be compared against- Returns:
- true if they're equal
-
hashCode
public int hashCode()Description copied from interface:OutputFunctionReturns a hash code value for this object- Specified by:
hashCodein interfaceOutputFunction- Overrides:
hashCodein classObject- Returns:
- a hash code value for this object
-