Package output
Class OutputCommutative
Object
OutputCommutative
- All Implemented Interfaces:
OutputFunction
public class OutputCommutative extends Object implements OutputFunction
Provides a parent class for all
OutputFunction
s of any number of commutative arguments-
Field Summary
Fields Modifier and Type Field Description protected String
functionName
The name of the functionprotected Collector<CharSequence,?,String>
latexJoiningCollector
ACollector
for generating outputLaTeX
stringsprotected Collector<CharSequence,?,String>
normalJoiningCollector
ACollector
for generating output text stringsprotected List<OutputFunction>
operands
The operands of the function -
Constructor Summary
Constructors Constructor Description OutputCommutative(String functionName, List<OutputFunction> operands)
Returns a newOutputUnitary
functionOutputCommutative(String functionName, List<OutputFunction> operands, Collector<CharSequence,?,String> normalJoiningCollector, Collector<CharSequence,?,String> latexJoiningCollector)
Returns a newOutputUnitary
functionOutputCommutative(String functionName, OutputFunction... operands)
Returns a newOutputUnitary
function -
Method Summary
Modifier and Type Method Description boolean
equals(Object that)
Checks if thisOutputFunction
is equal tothat
String
getName()
Returns the name of this functionCollection<OutputFunction>
getOperands()
Returns the operands of this function (its children in the function tree)int
hashCode()
Returns a hash code value for this objectString
toLatex()
Returns aLaTeX
representation of the function treeString
toString()
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> normalJoiningCollectorACollector
for generating output text strings -
latexJoiningCollector
protected final Collector<CharSequence,?,String> latexJoiningCollectorACollector
for generating outputLaTeX
strings -
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 newOutputUnitary
function- 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 newOutputUnitary
function- Parameters:
functionName
- the name of the functionoperands
- the operands of the function
-
OutputCommutative
Returns a newOutputUnitary
function- Parameters:
functionName
- the name of the functionoperands
- the operands of the function
-
-
Method Details
-
getName
public String getName()Description copied from interface:OutputFunction
Returns the name of this function- Specified by:
getName
in interfaceOutputFunction
- Returns:
- the name of this function
-
getOperands
Description copied from interface:OutputFunction
Returns the operands of this function (its children in the function tree)- Specified by:
getOperands
in interfaceOutputFunction
- Returns:
- a collection of operands
-
toString
public String toString()Description copied from interface:OutputFunction
Returns a text representation of the function tree- Specified by:
toString
in interfaceOutputFunction
- Overrides:
toString
in classObject
- Returns:
- a text representation of the function tree
-
toLatex
public String toLatex()Description copied from interface:OutputFunction
Returns aLaTeX
representation of the function tree- Specified by:
toLatex
in interfaceOutputFunction
- Returns:
- a
LaTeX
representation of the function tree
-
equals
public boolean equals(Object that)Description copied from interface:OutputFunction
Checks if thisOutputFunction
is equal tothat
- Specified by:
equals
in interfaceOutputFunction
- Overrides:
equals
in classObject
- Parameters:
that
- the object to be compared against- Returns:
- true if they're equal
-
hashCode
public int hashCode()Description copied from interface:OutputFunction
Returns a hash code value for this object- Specified by:
hashCode
in interfaceOutputFunction
- Overrides:
hashCode
in classObject
- Returns:
- a hash code value for this object
-