Class Complex
java.lang.Object
calculator.atoms.Complex
- All Implemented Interfaces:
Atom, Expression
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccepts the specific AtomVisitorvoidaccept is a method needed to implement the visitor design patternapply(BinaryFunction f, Atom a) Applies an Binary between two atoms of the same concrete type The function supposes that both atoms are of the same concrete typeApplies an operation on the atomApplies an operation between two atoms of the same concrete type The function supposes that both atoms are of the same concrete typebooleanorg.apache.commons.numbers.complex.ComplexgetValue()getter method to obtain the value contained in the objectinthashCode()booleanisNaN()Returns if a complex is a NaNstatic Complexnan()Returns a Complex representing a NaNtoString()
-
Constructor Details
-
Complex
public Complex(double real, double imaginary) Constructor method- Parameters:
real- The real partimaginary- The imaginary part
-
Complex
public Complex(org.apache.commons.numbers.complex.Complex value) Constructor method from an existing Complex object- Parameters:
value- The commons-numbers Complex object
-
-
Method Details
-
nan
-
isNaN
public boolean isNaN()Returns if a complex is a NaN- Returns:
- true iff the complex represents a NaN
-
getValue
public org.apache.commons.numbers.complex.Complex getValue()getter method to obtain the value contained in the object- Returns:
- The commons-numbers Complex number contained in the object
-
apply
Description copied from interface:AtomApplies an operation between two atoms of the same concrete type The function supposes that both atoms are of the same concrete type -
apply
Description copied from interface:AtomApplies an Binary between two atoms of the same concrete type The function supposes that both atoms are of the same concrete type -
apply
Description copied from interface:AtomApplies an operation on the atom -
accept
Description copied from interface:Atomaccepts the specific AtomVisitor -
accept
Description copied from interface:Expressionaccept is a method needed to implement the visitor design pattern- Specified by:
acceptin interfaceExpression- Parameters:
v- The visitor object being passed as a parameter
-
equals
-
hashCode
-
toString
-