public class SusiThought extends JSONObject
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
variable_pattern |
NULL
Constructor and Description |
---|
SusiThought()
create an empty thought, to be filled with single data entities.
|
SusiThought(JSONObject json)
create a clone of a json object as a SusiThought object
|
SusiThought(java.util.regex.Matcher matcher)
Create an initial thought using the matcher on an expression.
|
SusiThought(java.lang.String metadata_name,
java.lang.String data_name)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
SusiThought |
addAction(SusiAction action) |
SusiThought |
addActions(java.util.List<SusiAction> actions)
Every information may have a set of (re-)actions assigned.
|
SusiThought |
addObservation(java.lang.String featureName,
java.lang.String observation)
If during thinking we observe something that we want to memorize, we can memorize this here.
|
SusiThought |
addTimes(int t) |
boolean |
equals(java.lang.Object o) |
java.util.List<SusiAction> |
getActions()
To be able to apply (re-)actions to this thought, the actions on the information can be retrieved.
|
int |
getCount()
The number of information pieces in a set of informations may have a count.
|
JSONArray |
getData()
Information contained in this thought can get returned as a table, a set of information pieces.
|
int |
getHits() |
java.lang.String |
getObservation(java.lang.String featureName) |
java.util.List<java.lang.String> |
getObservations(java.lang.String featureName) |
int |
getOffset() |
java.lang.String |
getQuery() |
java.util.List<java.lang.String> |
getSkills() |
int |
getTimes() |
boolean |
hasEmptyObservation(java.lang.String key) |
boolean |
isFailed() |
static void |
main(java.lang.String[] args) |
SusiThought |
mergeData(JSONArray table1)
Merging of data is required during an mind-meld.
|
SusiThought |
setData(JSONArray table)
Information contained in this thought has the form of a result set table, organized in rows and columns.
|
SusiThought |
setHits(int hits)
While the number of information pieces in a whole has a count, the number of relevant
information pieces may have been extracted.
|
SusiThought |
setOffset(int offset)
In a series of information pieces the first information piece has number 0.
|
SusiThought |
setProcess(java.lang.String processName)
The process which created this thought may have a name or description string.
|
SusiThought |
setQuery(java.lang.String query)
If this thought was the result of a retrieval using a specific expression, that expression is
called the query.
|
SusiThought |
setScraperInfo(java.lang.String scraperInfo)
If the expression to create this thought had an agent that expressed the result set of the
information contained in this thought, it is called the scraper.
|
SusiThought |
setTimes(int t) |
JSONObject |
toJSON() |
java.lang.String |
toString()
Make a JSON text of this JSONObject.
|
java.lang.String |
unify(java.lang.String statement,
boolean urlencode)
Unification applies a piece of memory within the current argument to a statement
which creates an instantiated statement
|
accumulate, append, doubleToString, get, getBigDecimal, getBigInteger, getBoolean, getDouble, getEnum, getInt, getJSONArray, getJSONObject, getLong, getNames, getNames, getString, has, increment, isNull, keys, keySet, length, names, numberToString, opt, optBigDecimal, optBigInteger, optBoolean, optBoolean, optDouble, optDouble, optEnum, optEnum, optInt, optInt, optJSONArray, optJSONObject, optLong, optLong, optString, optString, put, put, put, put, put, put, put, putAll, putOnce, putOpt, quote, quote, remove, similar, stringToValue, testValidity, toJSONArray, toMap, toString, valueToString, wrap, write, write
public SusiThought()
public SusiThought(JSONObject json)
json
- the 'other' thought, probably an exported and re-imported thoughtpublic SusiThought(java.util.regex.Matcher matcher)
matcher
- @Deprecated public SusiThought(java.lang.String metadata_name, java.lang.String data_name)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public SusiThought setTimes(int t)
public SusiThought addTimes(int t)
public int getTimes()
public SusiThought setOffset(int offset)
offset
- the offset to a previous set of information pieces.public int getOffset()
public int getCount()
public boolean isFailed()
public boolean hasEmptyObservation(java.lang.String key)
public SusiThought setHits(int hits)
hits
- number of information piecespublic int getHits()
public SusiThought setProcess(java.lang.String processName)
query
- the process which formed this thoughtpublic SusiThought setQuery(java.lang.String query)
query
- the expression which caused that this thought was formedpublic java.lang.String getQuery()
public SusiThought setScraperInfo(java.lang.String scraperInfo)
scraperInfo
- the scraper that created this thoughtpublic SusiThought setData(JSONArray table)
table
- the information for this thought.public JSONArray getData()
public SusiThought mergeData(JSONArray table1)
table
- the information to be melted into our existing table.public SusiThought addObservation(java.lang.String featureName, java.lang.String observation)
featureName
- the object keyobservation
- the object valuepublic java.util.List<java.lang.String> getObservations(java.lang.String featureName)
public java.lang.String getObservation(java.lang.String featureName)
public SusiThought addActions(java.util.List<SusiAction> actions)
actions
- (re-)actions on this thoughtpublic SusiThought addAction(SusiAction action)
public java.util.List<SusiAction> getActions()
public java.util.List<java.lang.String> getSkills()
public java.lang.String unify(java.lang.String statement, boolean urlencode)
statement
- public JSONObject toJSON()
public java.lang.String toString()
JSONObject
Warning: This method assumes that the data structure is acyclical.
toString
in class JSONObject
{
(left
brace) and ending with }
(right
brace).public static void main(java.lang.String[] args)