|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectchordDiagrams.Relation
public class Relation
This class stores a diagram relation
| Field Summary | |
|---|---|
static double |
epsilon
All values with absolute value less than epsilon are counted as zeros |
java.util.TreeMap<java.lang.Integer,java.lang.Double> |
relation
Holds DiagramID - Coefficient pairs |
private java.lang.String |
relationID
Relation ID |
static long |
serialVersionUID
Serialization Version UID |
| Constructor Summary | |
|---|---|
Relation()
Constructs an instance of the relation |
|
| Method Summary | |
|---|---|
static java.lang.String |
coefToString(double D)
Returns a string representation of a coefficient |
int |
compareTo(Relation r)
Compares this relation to another via String ID's |
boolean |
equals_ex(Relation r)
Compares this relation to another relation |
boolean |
equals(Relation r)
|
java.lang.String |
ID()
Returns relation ID |
static boolean |
isZero(double d)
Tells if a double is "zero", i.e. |
boolean |
nonEmpty()
Tells whether there are any terms in the relations |
void |
putEntry(java.lang.Integer diagID,
double coef)
Adds a diagram with a coefficient to the relation |
void |
setID()
Sets the relation ID string |
int |
size()
Tells how many terms there are in this relation |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final double epsilon
public java.util.TreeMap<java.lang.Integer,java.lang.Double> relation
private java.lang.String relationID
public static final long serialVersionUID
| Constructor Detail |
|---|
public Relation()
| Method Detail |
|---|
public void putEntry(java.lang.Integer diagID,
double coef)
diagID - diagram IDcoef - diagram coefficientpublic boolean nonEmpty()
public int size()
public boolean equals_ex(Relation r)
r - another relation
public boolean equals(Relation r)
public int compareTo(Relation r)
compareTo in interface java.lang.Comparable<Relation>public void setID()
public java.lang.String ID()
public static boolean isZero(double d)
d - double to check
public java.lang.String toString()
toString in class java.lang.Objectpublic static java.lang.String coefToString(double D)
D - coefficient
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||