|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnars.entity.Stamp
public class Stamp
Each Sentence has a get of serial numbers of a constant length attached. The input sentence gets a unique number. The derived sentences inherits from its parents, then cut at the length limit.
| Field Summary | |
|---|---|
private long |
creationTime
creation time of the stamp |
private static long |
current
serial number, for the whole system |
private int |
length
current stamp length |
private long[] |
list
serial numbers |
| Constructor Summary | |
|---|---|
|
Stamp()
Generate a new stamp, with a new serial number, for input sentence |
private |
Stamp(Stamp first,
Stamp second)
Generate a new stamp for derived sentence by merging the two from parents the first one is no shorter than the second |
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object that)
Check if two stamps contains the same set of numbers |
(package private) long |
get(int i)
Get a number from the list by index, called in this class only |
long |
getCreationTime()
Get the creationTime of the truth-value |
int |
hashCode()
The hash code of Stamp |
static void |
init()
Initialize the stamp machenism of the system, called in Center |
int |
length()
Return the length of the list |
static Stamp |
make(Stamp first,
Stamp second)
Try to merge two Stamps, return null if have overlap |
TemporalValue |
orderWith(Stamp that)
Compare two Stamps for their temporal order |
(package private) java.util.TreeSet<java.lang.Long> |
toSet()
Convert the list into a set |
java.lang.String |
toString()
Get a String form of the Stamp for display |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static long current
private long[] list
private int length
private final long creationTime
| Constructor Detail |
|---|
public Stamp()
private Stamp(Stamp first,
Stamp second)
first - The first Stampsecond - The second Stamp| Method Detail |
|---|
public static Stamp make(Stamp first,
Stamp second)
first - The first Stampsecond - The second Stamp
public static void init()
public int length()
long get(int i)
i - The index
java.util.TreeSet<java.lang.Long> toSet()
public boolean equals(java.lang.Object that)
equals in class java.lang.Objectthat - The Stamp to be compared
public int hashCode()
hashCode in class java.lang.Objectpublic long getCreationTime()
public TemporalValue orderWith(Stamp that)
that - The Stamp to be compared
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||