Package functions.unitary
Class UnitaryFunction
Object
GeneralFunction
UnitaryFunction
- All Implemented Interfaces:
Differentiable,Evaluable,Outputable,Simplifiable,Comparable<GeneralFunction>,Iterable<GeneralFunction>
- Direct Known Subclasses:
GeneralTrigFunction,IntegerUnitaryFunction,PiecewiseFunction,SpecialCaseBinaryFunction,Transformation
public abstract class UnitaryFunction extends GeneralFunction
-
Field Summary
Fields Modifier and Type Field Description GeneralFunctionoperandTheGeneralFunctionwhich theUnitaryFunctionoperates on -
Constructor Summary
Constructors Constructor Description UnitaryFunction(GeneralFunction operand)Constructs a newUnitaryFunction -
Method Summary
Modifier and Type Method Description UnitaryFunctionclone()Returns a clone of thisGeneralFunctionintcompareSelf(GeneralFunction that)Used internally for comparing two functions of the same exact typebooleanequalsFunction(GeneralFunction that)Returns true when the two fully-simplified functions are equalabstract UnitaryFunctiongetInstance(GeneralFunction operand)Returns a new instance of thisUnitaryFunctioninthashCode()Returns a hash code value for this object@NotNull Iterator<GeneralFunction>iterator()Returns an iterator over the operands of thisGeneralFunctionstatic UnitaryFunctionnewInstanceOf(Class<?> type, GeneralFunction operand)Returns aUnitaryFunctionof the given type and of the given operandGeneralFunctionsimplify()Returns thisGeneralFunction, simplifiedGeneralFunctionsimplifyFOC()UnitaryFunctionsimplifyInternal()Simplifies theoperandusingSimplifiable.simplify()GeneralFunctionsimplifyInverse()Ifoperandis an instance of the inverse of this function, returnsoperand.operandGeneralFunctionsubstituteAll(Predicate<? super GeneralFunction> test, Function<? super GeneralFunction,? extends GeneralFunction> replacer)OutputFunctiontoOutputFunction()Converts this function into anOutputFunctionfor use in string conversionStringtoString()Returns a String representation of thisGeneralFunctionMethods inherited from class GeneralFunction
compareTo, derivativeAt, equals, equalsSimplified, getNthDerivative, getSimplifiedDerivative, substituteVariables
-
Field Details
-
operand
TheGeneralFunctionwhich theUnitaryFunctionoperates on
-
-
Constructor Details
-
UnitaryFunction
Constructs a newUnitaryFunction- Parameters:
operand- TheGeneralFunctionwhich will be operated on
-
-
Method Details
-
toString
public String toString()Description copied from class:GeneralFunctionReturns a String representation of thisGeneralFunction- Specified by:
toStringin classGeneralFunction- Returns:
- String representation of this function
-
simplify
Description copied from interface:SimplifiableReturns thisGeneralFunction, simplified- Returns:
- the simplified function
-
simplifyFOC
- Returns:
- a new
Constantof theUnitaryFunctionevaluated if theoperandis aConstant
-
simplifyInverse
Ifoperandis an instance of the inverse of this function, returnsoperand.operand- Returns:
operand.operandifoperandis an instance of the inverse, andthisotherwise
-
getInstance
Returns a new instance of thisUnitaryFunction- Parameters:
operand- theGeneralFunctionto be operated on- Returns:
- a new instance of this
UnitaryFunction
-
clone
Description copied from class:GeneralFunctionReturns a clone of thisGeneralFunction- Specified by:
clonein classGeneralFunction- Returns:
- a clone of this function
-
simplifyInternal
Simplifies theoperandusingSimplifiable.simplify()- Returns:
- an instance of this
UnitaryFunctionwith theoperandsimplified
-
substituteAll
public GeneralFunction substituteAll(Predicate<? super GeneralFunction> test, Function<? super GeneralFunction,? extends GeneralFunction> replacer)Description copied from class:GeneralFunction- Specified by:
substituteAllin classGeneralFunction- Parameters:
test- checks if the function should be replacedreplacer- replaces the function- Returns:
- a new
GeneralFunctionwith all replacements made
-
equalsFunction
Description copied from class:GeneralFunctionReturns true when the two fully-simplified functions are equal- Specified by:
equalsFunctionin classGeneralFunction- Parameters:
that- TheGeneralFunctionthat the current function is being checked against- Returns:
- true if the two functions are equal
-
compareSelf
Description copied from class:GeneralFunctionUsed internally for comparing two functions of the same exact type- Specified by:
compareSelfin classGeneralFunction- Parameters:
that- theGeneralFunctionthat this is compared against- Returns:
- the comparison
-
toOutputFunction
Description copied from interface:OutputableConverts this function into anOutputFunctionfor use in string conversion- Returns:
- this function as an
OutputFunction
-
newInstanceOf
Returns aUnitaryFunctionof the given type and of the given operand- Parameters:
type- TheClassof theUnitaryFunctionbeing returnedoperand- Theoperandof theUnitaryFunction- Returns:
- a new
UnitaryFunctionof the given type and of the given operand
-
hashCode
public int hashCode()Description copied from class:GeneralFunctionReturns a hash code value for this object- Specified by:
hashCodein classGeneralFunction- Returns:
- a hash code value for this object
-
iterator
Description copied from class:GeneralFunctionReturns an iterator over the operands of thisGeneralFunction- Specified by:
iteratorin interfaceIterable<GeneralFunction>- Specified by:
iteratorin classGeneralFunction- Returns:
- an iterator over the operands of this
GeneralFunction
-