Class ExtendedOperatorSet

  • All Implemented Interfaces:
    JepComponent, OperatorTableI, java.io.Serializable

    public class ExtendedOperatorSet
    extends StandardOperatorTable2
    A example of an OperatorSet which adds two suffix operators: n! (factorial) and n% (percentage).

    Since 3.5 the ternary conditional has been removed as this is already part of the JavaOperatorSet. The Factorial function has been moved from an inner class to its own class Factorial.

    See Also:
    Serialized Form
    • Constructor Detail

      • ExtendedOperatorSet

        public ExtendedOperatorSet()
      • ExtendedOperatorSet

        public ExtendedOperatorSet​(OperatorTable2 oldTable)
        Parameters:
        oldTable -
    • Method Detail

      • setExtendedPfmcs

        protected void setExtendedPfmcs()
      • shallowCopy

        public OperatorTableI shallowCopy()
        Description copied from class: EmptyOperatorTable
        Create a new version of this OperatorTable. Operators are copied into new table. However Operators whose pfmc implement JepComponent are duplicated. This means the table could be used in a separate thread without problem. Subclasses should override with method to return a table of the correct type, a typical implementation would be
            @Override
            public OperatorTableI shallowCopy() {
                Map<OperatorKey, Operator> map = this.threadSafeMapCopy();
                return new MyOperatorTable(map);
            }
         
        using the EmptyOperatorTable.threadSafeMapCopy() method to return a copy of the map of operators and a constructor taking this map which uses the EmptyOperatorTable(Map) constructor.
        Specified by:
        shallowCopy in interface OperatorTableI
        Overrides:
        shallowCopy in class StandardOperatorTable2
        Returns:
        a new Table