Serializable
, Cloneable
public class Stamp extends Object implements Cloneable, Serializable
Modifier and Type | Class | Description |
---|---|---|
static class |
Stamp.BaseEntry |
Element of the evidential base of stamp
|
Modifier and Type | Field | Description |
---|---|---|
boolean |
alreadyAnticipatedNegConfirmation |
is it a neg confirmation task that was already checked
|
int |
baseLength |
the length of @see evidentialBase
|
private long |
creationTime |
creation time of the stamp
|
static long |
ETERNAL |
default for atemporal events means "always" in Judgment/Question, but "current" in Goal/Quest
|
Stamp.BaseEntry[] |
evidentialBase |
serial numbers.
|
private int |
evidentialHash |
cache of hashcode of evidential base
|
private Stamp.BaseEntry[] |
evidentialSet |
caches evidentialBase as a set for comparisons and hashcode, stores the unique Long's in-order for efficiency
|
(package private) CharSequence |
name |
caches
|
private long |
occurrenceTime |
estimated occurrence time of the event
|
private Tense |
tense |
Tense of the item
|
Modifier | Constructor | Description |
---|---|---|
|
Stamp(long time,
Tense tense,
Stamp.BaseEntry serial,
int duration) |
Generate a new stamp, with a new serial number, for a new Task
|
private |
Stamp(Stamp old) |
Generate a new stamp identical with a given one
|
|
Stamp(Stamp old,
long creationTime) |
Generate a new stamp from an existing one, with the same evidentialBase
but different creation time
|
|
Stamp(Stamp old,
long creationTime,
Stamp useEvidentialBase) |
|
|
Stamp(Stamp first,
Stamp second,
long time,
Parameters narParameters) |
Generate a new stamp for derived sentence by merging the two from parents
the first one is no shorter than the second
|
|
Stamp(Timable time,
Memory memory) |
creates a stamp with default Present tense
|
|
Stamp(Timable time,
Memory memory,
Tense tense) |
|
protected |
Stamp(Tense tense,
Stamp.BaseEntry serial) |
used for when the ocrrence time will be set later; so should not be called from externally but through another Stamp constructor
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
after(Stamp s,
int duration) |
|
StringBuilder |
appendOcurrenceTime(StringBuilder sb) |
|
static boolean |
baseOverlap(Stamp a,
Stamp b) |
Detects evidental base overlaps
|
boolean |
before(Stamp s,
int duration) |
|
Stamp |
clone() |
Clone a stamp
|
Stamp |
cloneWithNewOccurrenceTime(long newOcurrenceTime) |
|
boolean |
equals(Object that) |
|
boolean |
equals(Stamp s,
boolean creationTime,
boolean ocurrenceTime,
boolean evidentialBase) |
Check if two stamps contains the same types of content
|
boolean |
evidenceIsCyclic() |
|
int |
evidentialHash() |
hash code of Stamp
|
long |
getCreationTime() |
|
long |
getOccurrenceTime() |
Get the occurrenceTime of the truth-value
|
String |
getOccurrenceTimeString() |
Get the occurrenceTime of the truth-value
|
float |
getOriginality() |
|
String |
getTense(long currentTime,
int duration) |
|
boolean |
isEternal() |
|
CharSequence |
name() |
|
void |
setCreationTime(long time,
int duration) |
sets the creation time; used to set input tasks with the actual time they enter Memory
|
void |
setEternal() |
|
void |
setOccurrenceTime(long time) |
|
private Stamp.BaseEntry[] |
toSet() |
Convert the evidentialBase into a set
|
static Stamp.BaseEntry[] |
toSetArray(Stamp.BaseEntry[] x) |
|
String |
toString() |
public Stamp.BaseEntry[] evidentialBase
public int baseLength
private long creationTime
private long occurrenceTime
public static final long ETERNAL
private Stamp.BaseEntry[] evidentialSet
private Tense tense
public boolean alreadyAnticipatedNegConfirmation
CharSequence name
private int evidentialHash
protected Stamp(Tense tense, Stamp.BaseEntry serial)
public Stamp(long time, Tense tense, Stamp.BaseEntry serial, int duration)
time
- Creation time of the stampprivate Stamp(Stamp old)
old
- The stamp to be clonedpublic Stamp(Stamp old, long creationTime)
For single-premise rules
old
- The stamp of the single premisecreationTime
- The current timepublic Stamp(Stamp first, Stamp second, long time, Parameters narParameters)
first
- The first Stampsecond
- The second Stamppublic boolean before(Stamp s, int duration)
public boolean after(Stamp s, int duration)
public float getOriginality()
public boolean evidenceIsCyclic()
public boolean isEternal()
public void setCreationTime(long time, int duration)
public static Stamp.BaseEntry[] toSetArray(Stamp.BaseEntry[] x)
private Stamp.BaseEntry[] toSet()
public boolean equals(Stamp s, boolean creationTime, boolean ocurrenceTime, boolean evidentialBase)
s
- The Stamp to be comparedpublic final int evidentialHash()
public Stamp cloneWithNewOccurrenceTime(long newOcurrenceTime)
public long getOccurrenceTime()
public void setEternal()
public StringBuilder appendOcurrenceTime(StringBuilder sb)
public String getOccurrenceTimeString()
public String getTense(long currentTime, int duration)
public void setOccurrenceTime(long time)
public CharSequence name()
public long getCreationTime()
Copyright © 2020 OpenNARS. All rights reserved.