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 GeneralFunction
operand
TheGeneralFunction
which theUnitaryFunction
operates on -
Constructor Summary
Constructors Constructor Description UnitaryFunction(GeneralFunction operand)
Constructs a newUnitaryFunction
-
Method Summary
Modifier and Type Method Description UnitaryFunction
clone()
Returns a clone of thisGeneralFunction
int
compareSelf(GeneralFunction that)
Used internally for comparing two functions of the same exact typeboolean
equalsFunction(GeneralFunction that)
Returns true when the two fully-simplified functions are equalabstract UnitaryFunction
getInstance(GeneralFunction operand)
Returns a new instance of thisUnitaryFunction
int
hashCode()
Returns a hash code value for this object@NotNull Iterator<GeneralFunction>
iterator()
Returns an iterator over the operands of thisGeneralFunction
static UnitaryFunction
newInstanceOf(Class<?> type, GeneralFunction operand)
Returns aUnitaryFunction
of the given type and of the given operandGeneralFunction
simplify()
Returns thisGeneralFunction
, simplifiedGeneralFunction
simplifyFOC()
UnitaryFunction
simplifyInternal()
Simplifies theoperand
usingSimplifiable.simplify()
GeneralFunction
simplifyInverse()
Ifoperand
is an instance of the inverse of this function, returnsoperand.operand
GeneralFunction
substituteAll(Predicate<? super GeneralFunction> test, Function<? super GeneralFunction,? extends GeneralFunction> replacer)
OutputFunction
toOutputFunction()
Converts this function into anOutputFunction
for use in string conversionString
toString()
Returns a String representation of thisGeneralFunction
Methods inherited from class GeneralFunction
compareTo, derivativeAt, equals, equalsSimplified, getNthDerivative, getSimplifiedDerivative, substituteVariables
-
Field Details
-
operand
TheGeneralFunction
which theUnitaryFunction
operates on
-
-
Constructor Details
-
UnitaryFunction
Constructs a newUnitaryFunction
- Parameters:
operand
- TheGeneralFunction
which will be operated on
-
-
Method Details
-
toString
public String toString()Description copied from class:GeneralFunction
Returns a String representation of thisGeneralFunction
- Specified by:
toString
in classGeneralFunction
- Returns:
- String representation of this function
-
simplify
Description copied from interface:Simplifiable
Returns thisGeneralFunction
, simplified- Returns:
- the simplified function
-
simplifyFOC
- Returns:
- a new
Constant
of theUnitaryFunction
evaluated if theoperand
is aConstant
-
simplifyInverse
Ifoperand
is an instance of the inverse of this function, returnsoperand.operand
- Returns:
operand.operand
ifoperand
is an instance of the inverse, andthis
otherwise
-
getInstance
Returns a new instance of thisUnitaryFunction
- Parameters:
operand
- theGeneralFunction
to be operated on- Returns:
- a new instance of this
UnitaryFunction
-
clone
Description copied from class:GeneralFunction
Returns a clone of thisGeneralFunction
- Specified by:
clone
in classGeneralFunction
- Returns:
- a clone of this function
-
simplifyInternal
Simplifies theoperand
usingSimplifiable.simplify()
- Returns:
- an instance of this
UnitaryFunction
with theoperand
simplified
-
substituteAll
public GeneralFunction substituteAll(Predicate<? super GeneralFunction> test, Function<? super GeneralFunction,? extends GeneralFunction> replacer)Description copied from class:GeneralFunction
- Specified by:
substituteAll
in classGeneralFunction
- Parameters:
test
- checks if the function should be replacedreplacer
- replaces the function- Returns:
- a new
GeneralFunction
with all replacements made
-
equalsFunction
Description copied from class:GeneralFunction
Returns true when the two fully-simplified functions are equal- Specified by:
equalsFunction
in classGeneralFunction
- Parameters:
that
- TheGeneralFunction
that the current function is being checked against- Returns:
- true if the two functions are equal
-
compareSelf
Description copied from class:GeneralFunction
Used internally for comparing two functions of the same exact type- Specified by:
compareSelf
in classGeneralFunction
- Parameters:
that
- theGeneralFunction
that this is compared against- Returns:
- the comparison
-
toOutputFunction
Description copied from interface:Outputable
Converts this function into anOutputFunction
for use in string conversion- Returns:
- this function as an
OutputFunction
-
newInstanceOf
Returns aUnitaryFunction
of the given type and of the given operand- Parameters:
type
- TheClass
of theUnitaryFunction
being returnedoperand
- Theoperand
of theUnitaryFunction
- Returns:
- a new
UnitaryFunction
of the given type and of the given operand
-
hashCode
public int hashCode()Description copied from class:GeneralFunction
Returns a hash code value for this object- Specified by:
hashCode
in classGeneralFunction
- Returns:
- a hash code value for this object
-
iterator
Description copied from class:GeneralFunction
Returns an iterator over the operands of thisGeneralFunction
- Specified by:
iterator
in interfaceIterable<GeneralFunction>
- Specified by:
iterator
in classGeneralFunction
- Returns:
- an iterator over the operands of this
GeneralFunction
-