|
|||||||||
| Home >> All >> com >> hartmath >> [ expression overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.hartmath.expression
Class HComplex

java.lang.Objectcom.hartmath.expression.HComplex
- public class HComplex
- extends java.lang.Object
- implements HObject, HNumber
- extends java.lang.Object
Immutable arbitrary-precision complex.
| Field Summary | |
(package private) HFraction |
imag
|
(package private) HFraction |
real
|
| Fields inherited from interface com.hartmath.expression.HObject |
COMPLEXFILEID, COMPLEXID, DOUBLECOMPLEXFILEID, DOUBLECOMPLEXID, DOUBLEFILEID, DOUBLEID, FRACTIONFILEID, FRACTIONID, FUNCTIONFILEID, FUNCTIONID, INTEGERFILEID, INTEGERID, OBJECTID, PATTERNFILEID, PATTERNID, STRINGFILEID, STRINGID, SYMBOLFILEID, SYMBOLID |
| Constructor Summary | |
|
HComplex(HFraction r,
HFraction i)
Class Constructor. |
|
HComplex(HFraction r,
HInteger d)
Class Constructor. |
|
HComplex(HInteger n,
HFraction d)
Class Constructor. |
|
HComplex(HInteger n,
HInteger d)
Class Constructor. |
(package private) |
HComplex(java.lang.String strrn,
int rin,
java.lang.String strrd,
int rid,
java.lang.String strin,
int iin,
java.lang.String strid,
int iid)
Class Constructor. |
(package private) |
HComplex(java.lang.String strrn,
java.lang.String strrd,
java.lang.String strin,
java.lang.String strid)
Class Constructor. |
| Method Summary | |
HObject |
abs(com.hartmath.lib.Session session)
Returns the absolute value. |
HComplex |
add(HComplex parm1)
Method Declaration. |
HObject |
apply(HObject head,
com.hartmath.lib.Session session)
Description of the Method |
int |
compSignum()
0 for this == 0; +1 for re(this) > 0 or ( re(this)==0 and im(this)>0 ); -1 for re(this) < 0 or ( re(this)==0 and im(this)<0 ); |
HObject |
conjugate()
returns the conjugate complex of a number |
HComplex |
divide(HComplex parm1)
Method Declaration. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. |
HObject |
evaluate(com.hartmath.lib.Session session)
Returns true if this can be evaluated. |
boolean |
greater(com.hartmath.lib.Session session,
java.lang.Object obj)
Method Declaration. |
int |
hashCode()
Returns a hash code value for the object. |
HSymbol |
head()
Method Declaration. |
int |
hierarchy()
Returns an specific integer value for each class in the math-objects hierarchy |
HObject |
im()
returns the imaginary part of a number |
boolean |
isEqual(HComplex b)
Method Declaration. |
boolean |
isHeadMember(HSymbol sym)
Method Declaration. |
boolean |
isList()
Method Declaration. |
boolean |
isMember(HObject obj)
Method Declaration. |
boolean |
isNonZero()
Method Declaration. |
boolean |
isNumber()
Method Declaration. |
boolean |
isRational()
Method Declaration. |
boolean |
isUnequal(HComplex b)
Method Declaration. |
boolean |
isZero()
Method Declaration. |
boolean |
less(com.hartmath.lib.Session session,
java.lang.Object obj)
Method Declaration. |
boolean |
matches(HObject obj,
com.hartmath.lib.Session session)
Method Declaration. |
HComplex |
multiply(HComplex parm1)
Method Declaration. |
HComplex |
negate()
Method Declaration. |
HComplex |
pow(int parm1)
Method Declaration. |
int |
precedence()
Method Declaration. |
com.hartmath.prettyprint.PrettyPrintBox |
prettyPrint(java.lang.String font,
int fontSize)
Description of the Method |
com.hartmath.prettyprint.PrettyPrintBox |
prettyPrint(java.lang.String font,
int fontSize,
int precedence)
Description of the Method |
private void |
prettyPrintNumber(HFraction num,
boolean imaginary,
com.hartmath.prettyprint.HorizontalBox box,
java.lang.String font,
int fontSize)
Description of the Method |
HObject |
re()
returns the real part of a number |
HObject |
substitute(HObject obj,
HObject subst)
Returns true if this is (pattern-) matches the object obj |
HObject |
substitutePattern(com.hartmath.lib.Session session)
Method Declaration. |
HComplex |
subtract(HComplex parm1)
Method Declaration. |
java.lang.String |
toString()
Method Declaration. |
void |
toStringBuffer(java.lang.StringBuffer buf,
com.hartmath.lib.Session session)
Description of the Method |
boolean |
unequals(java.lang.Object obj)
Method Declaration. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
real
final HFraction real
imag
final HFraction imag
| Constructor Detail |
HComplex
public HComplex(HFraction r, HFraction i)
- Class Constructor.
HComplex
public HComplex(HInteger n, HInteger d)
- Class Constructor.
HComplex
public HComplex(HFraction r, HInteger d)
- Class Constructor.
HComplex
public HComplex(HInteger n, HFraction d)
- Class Constructor.
HComplex
HComplex(java.lang.String strrn, java.lang.String strrd, java.lang.String strin, java.lang.String strid)
- Class Constructor.
HComplex
HComplex(java.lang.String strrn, int rin, java.lang.String strrd, int rid, java.lang.String strin, int iin, java.lang.String strid, int iid)
- Class Constructor.
| Method Detail |
isEqual
public boolean isEqual(HComplex b)
- Method Declaration.
isUnequal
public boolean isUnequal(HComplex b)
- Method Declaration.
isZero
public boolean isZero()
isNonZero
public boolean isNonZero()
- Method Declaration.
isList
public boolean isList()
isNumber
public boolean isNumber()
isRational
public boolean isRational()
- Method Declaration.
- Specified by:
isRationalin interfaceHObject
isMember
public boolean isMember(HObject obj)
isHeadMember
public boolean isHeadMember(HSymbol sym)
- Method Declaration.
- Specified by:
isHeadMemberin interfaceHObject
matches
public boolean matches(HObject obj, com.hartmath.lib.Session session)
equals
public boolean equals(java.lang.Object obj)
- Indicates whether some other object is "equal to" this one.
unequals
public boolean unequals(java.lang.Object obj)
less
public boolean less(com.hartmath.lib.Session session, java.lang.Object obj)
greater
public boolean greater(com.hartmath.lib.Session session, java.lang.Object obj)
evaluate
public HObject evaluate(com.hartmath.lib.Session session)
- Returns true if
thiscan be evaluated.objis the evaluation result.
substitute
public HObject substitute(HObject obj, HObject subst)
- Returns true if
thisis (pattern-) matches the objectobj- Specified by:
substitutein interfaceHObject
substitutePattern
public HObject substitutePattern(com.hartmath.lib.Session session)
- Method Declaration.
- Specified by:
substitutePatternin interfaceHObject
hierarchy
public final int hierarchy()
- Returns an specific integer value for each class in the math-objects
hierarchy
head
public HSymbol head()
- Method Declaration.
Method Declaration. Method Declaration. Method Declaration. Method
Declaration. Method Declaration.
apply
public HObject apply(HObject head, com.hartmath.lib.Session session)
toString
public java.lang.String toString()
- Method Declaration.
toStringBuffer
public void toStringBuffer(java.lang.StringBuffer buf, com.hartmath.lib.Session session)
- Description of the Method
- Specified by:
toStringBufferin interfaceHObject
prettyPrint
public com.hartmath.prettyprint.PrettyPrintBox prettyPrint(java.lang.String font, int fontSize)
- Description of the Method
prettyPrint
public com.hartmath.prettyprint.PrettyPrintBox prettyPrint(java.lang.String font, int fontSize, int precedence)
- Description of the Method
abs
public HObject abs(com.hartmath.lib.Session session)
- Returns the absolute value. If the argument is not negative, the argument
is returned. If the argument is negative, the negation of the argument is
returned.
add
public HComplex add(HComplex parm1) throws java.lang.ArithmeticException
- Method Declaration.
divide
public HComplex divide(HComplex parm1) throws java.lang.ArithmeticException
- Method Declaration.
hashCode
public int hashCode()
- Returns a hash code value for the object. This method is
supported for the benefit of hashtables such as those provided by
java.util.Hashtable.
multiply
public HComplex multiply(HComplex parm1)
- Method Declaration.
negate
public HComplex negate()
- Method Declaration.
pow
public HComplex pow(int parm1) throws java.lang.ArithmeticException
- Method Declaration.
subtract
public HComplex subtract(HComplex parm1)
- Method Declaration.
precedence
public int precedence()
- Method Declaration.
- Specified by:
precedencein interfaceHObject
compSignum
public int compSignum()
- 0 for this == 0; +1 for re(this) > 0 or ( re(this)==0 and im(this)>0 ); -1
for re(this) < 0 or ( re(this)==0 and im(this)<0 );
- Specified by:
compSignumin interfaceHNumber
conjugate
public HObject conjugate()
re
public HObject re()
im
public HObject im()
prettyPrintNumber
private void prettyPrintNumber(HFraction num, boolean imaginary, com.hartmath.prettyprint.HorizontalBox box, java.lang.String font, int fontSize)
- Description of the Method
|
|||||||||
| Home >> All >> com >> hartmath >> [ expression overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.hartmath.expression.HComplex