|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.actor.util.SuperdenseTime
public class SuperdenseTime
This class defines the structure of superdense time used in domains having time involved in computation. A superdense time object, s, consists of a time stamp and an index, denoted as s = (t, n).
Two superdense time objects can be compared to see which one happens first. The order is defined by the relationship between their time stamps and indexes. In particular, given s_1 = (t_1, n_1) and s_2 = (t_2, n_2), s_1 happens earlier than s_2 (denoted as s_1 <= s_2), if t_1 < t_2 or (t_1 == t_2 and n_1 <= n_2). The equality relation holds only if both t_1 == t_2 and n_1 == n_2 hold.
Green (hyzheng) |
Green (hyzheng) |
Field Summary | |
---|---|
private int |
_index
|
private Time |
_timestamp
|
Constructor Summary | |
---|---|
SuperdenseTime(Time timeStamp,
int index)
Construct a superdense time object with the specified timestamp and index. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object superdenseTime)
Compare this superdense time object with the argument superdense time object for an order. |
int |
compareTo(SuperdenseTime superdenseTime)
Compare this superdense time object with the argument superdense time object for an order. |
int |
index()
Return the index. |
Time |
timestamp()
Return the timestamp. |
java.lang.String |
toString()
Return a description of this superdense time object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int _index
private Time _timestamp
Constructor Detail |
---|
public SuperdenseTime(Time timeStamp, int index)
timeStamp
- The time stamp.index
- The index.Method Detail |
---|
public final int compareTo(java.lang.Object superdenseTime)
compareTo
in interface java.lang.Comparable
superdenseTime
- The superdense time object to compare against.
java.lang.ClassCastException
- If the argument is not a superdense
time object.public final int compareTo(SuperdenseTime superdenseTime)
Their timestamps are compared first. If the two timestamps are not equal, their order defines the objects' order. Otherwise, the indexes are compared for the order, where the object with a smaller index happens earlier. If the two objects have the same timestamp and index, then they happen simultaneously.
superdenseTime
- The superdense time object to compare against.
public final int index()
public final Time timestamp()
public final java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |