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 String functionName
    The name of the function
    protected Collector<CharSequence,​?,​String> latexJoiningCollector
    A Collector for generating output LaTeX strings
    protected Collector<CharSequence,​?,​String> normalJoiningCollector
    A Collector for generating output text strings
    protected List<OutputFunction> operands
    The operands of the function
  • Constructor Summary

    Constructors 
    Constructor Description
    OutputCommutative​(String functionName, List<OutputFunction> operands)
    Returns a new OutputUnitary function
    OutputCommutative​(String functionName, List<OutputFunction> operands, Collector<CharSequence,​?,​String> normalJoiningCollector, Collector<CharSequence,​?,​String> latexJoiningCollector)
    Returns a new OutputUnitary function
    OutputCommutative​(String functionName, OutputFunction... operands)
    Returns a new OutputUnitary function
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(Object that)
    Checks if this OutputFunction is equal to that
    String getName()
    Returns the name of this function
    Collection<OutputFunction> getOperands()
    Returns the operands of this function (its children in the function tree)
    int hashCode()
    Returns a hash code value for this object
    String toLatex()
    Returns a LaTeX representation of the function tree
    String toString()
    Returns a text representation of the function tree

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • functionName

      protected final String functionName
      The name of the function
    • normalJoiningCollector

      protected final Collector<CharSequence,​?,​String> normalJoiningCollector
      A Collector for generating output text strings
    • latexJoiningCollector

      protected final Collector<CharSequence,​?,​String> latexJoiningCollector
      A Collector for generating output LaTeX strings
    • operands

      protected final List<OutputFunction> 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 new OutputUnitary function
      Parameters:
      functionName - the name of the function
      operands - the operands of the function
      normalJoiningCollector - the joining collector for basic toString()
      latexJoiningCollector - the joining collector for toLatex()
    • OutputCommutative

      public OutputCommutative​(String functionName, List<OutputFunction> operands)
      Returns a new OutputUnitary function
      Parameters:
      functionName - the name of the function
      operands - the operands of the function
    • OutputCommutative

      public OutputCommutative​(String functionName, OutputFunction... operands)
      Returns a new OutputUnitary function
      Parameters:
      functionName - the name of the function
      operands - 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 interface OutputFunction
      Returns:
      the name of this function
    • getOperands

      public Collection<OutputFunction> getOperands()
      Description copied from interface: OutputFunction
      Returns the operands of this function (its children in the function tree)
      Specified by:
      getOperands in interface OutputFunction
      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 interface OutputFunction
      Overrides:
      toString in class Object
      Returns:
      a text representation of the function tree
    • toLatex

      public String toLatex()
      Description copied from interface: OutputFunction
      Returns a LaTeX representation of the function tree
      Specified by:
      toLatex in interface OutputFunction
      Returns:
      a LaTeX representation of the function tree
    • equals

      public boolean equals​(Object that)
      Description copied from interface: OutputFunction
      Checks if this OutputFunction is equal to that
      Specified by:
      equals in interface OutputFunction
      Overrides:
      equals in class Object
      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 interface OutputFunction
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object