|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Vertex
Represents a piece of knowledge. Vertex is a very simple structure mainly comprised of its relationships, this gives the system a very simple and extendable structure. Basic implementation to allow subclasses to avoid defining some of the basic stuff. The data attribute allows for vertices that represents something tangible such as text, sound, image, number, etc. The data is also indexed within a network, so is the only guaranteed way to lookup an existing vertex.
Method Summary | |
---|---|
Relationship |
addRelationship(Primitive type,
Primitive target)
Add the relation of the relationship primitive type to the target primitive. |
Relationship |
addRelationship(Primitive type,
Primitive target,
int index)
Add the relation of the relationship type to the target vertex. |
Relationship |
addRelationship(Primitive type,
Vertex target)
Add the relation of the relationship primitive type to the target vertex. |
Relationship |
addRelationship(Primitive type,
Vertex target,
int index)
Add the relation of the relationship type to the target vertex. |
Relationship |
addRelationship(Relationship relationship,
boolean internal)
Add the relation ensuring uniqueness. |
Relationship |
addRelationship(Vertex type,
Vertex target)
Add the relation of the type to the other vertex. |
Relationship |
addRelationship(Vertex type,
Vertex target,
int index)
Add the relation of the relationship type to the target vertex. |
Relationship |
addRelationship(Vertex type,
Vertex target,
int index,
boolean internal)
Add the relation of the type to the other vertex. |
Relationship |
addWeakRelationship(Primitive type,
Vertex target,
float correctnessMultiplier)
Add the relation of the relationship type to the target vertex. |
Relationship |
addWeakRelationship(Vertex type,
Vertex target,
float correctnessMultiplier)
Add the relation of the relationship type to the target vertex. |
java.util.Iterator<Relationship> |
allRelationships()
Provides an easier method of traversing all the relations of a vertex. |
Vertex |
applyQuotient(java.util.Map<Vertex,Vertex> variables)
Apply the quotient. |
void |
associateAll(Vertex relationshipType,
Vertex target,
Vertex type)
Associate each of the relationship target vertices with the target vertex by the type. |
boolean |
collectMatches(Vertex vertex,
java.util.Map<Vertex,java.util.Set<Vertex>> matches)
Compare if the two vertices match. |
void |
decrementConsciousnessLevel()
Decrease the vertices's level of consciousness. |
void |
decrementConsciousnessLevel(int amount)
Decrease the vertices's level of consciousness by the amount. |
java.lang.String |
description()
Return a short toString, or header of the vertex. |
boolean |
equalsIgnoreCase(Vertex vertex)
Compare the vertices ignoring case. |
void |
fixRelationships(Vertex type)
Fix the corrupted relationship index order. |
int |
getAccessCount()
Return the number of times the vertex has been accessed. |
java.util.Calendar |
getAccessDate()
Return the date the vertex was last accessed. |
int |
getConsciousnessLevel()
Return the vertices's level of consciousness. |
java.util.Calendar |
getCreationDate()
Return the date the vertex was created. |
java.lang.Object |
getData()
Allows some piece of data to be associated with the vertex. |
java.lang.String |
getDataType()
Return the String name of the data's type. |
java.lang.String |
getDataValue()
Return the String value of the data. |
java.lang.Long |
getId()
Unique id for the vertex. |
java.lang.String |
getName()
Return the name of the vertex. |
Network |
getNetwork()
Return the network the vertex is derived from. |
Vertex |
getRelationship(Primitive type)
Return any relationship target of the primitive type. |
Relationship |
getRelationship(Primitive type,
Primitive target)
Return the relationship to the target of the primitive type. |
Relationship |
getRelationship(Primitive type,
Vertex target)
Return the relationship to the target of the primitive type. |
Vertex |
getRelationship(Vertex type)
Return any relationship target of the type. |
Relationship |
getRelationship(Vertex type,
Vertex target)
Return the relationship to the target of the primitive type. |
java.util.Map<Vertex,java.util.Map<Relationship,Relationship>> |
getRelationships()
Return all relationships. |
java.util.Collection<Relationship> |
getRelationships(Primitive type)
Return any relationship target of the primitive type. |
java.util.Collection<Relationship> |
getRelationships(Vertex relationshipType)
Return all relationships of the type. |
boolean |
hasAnyRelationshipToTarget(Vertex target)
Return if the vertex has any relationship to any target. |
boolean |
hasAnyRelationshipToTargetOfType(Vertex classification)
Return if the vertex has any relationship to any target that is an instantiation of the classification. |
boolean |
hasData()
Most pure knowledge vertices have no data, this provides an easy test method. |
boolean |
hasInverseRelationship(Vertex type,
Vertex target)
Return if the vertex has an inverse/negative relationship of the type to the target. |
boolean |
hasName()
Some vertices have no name, this provides an easy test method. |
boolean |
hasRelationship(Primitive type)
Return if the vertex has a relationship of the type primitive. |
boolean |
hasRelationship(Primitive type,
Primitive target)
Return if the vertex has a relationship of the type primitive to the target primitive. |
boolean |
hasRelationship(Primitive type,
Vertex target)
Return if the vertex has a relationship of the type primitive to the target. |
boolean |
hasRelationship(Vertex type)
Return if the vertex has any relationship of the type. |
boolean |
hasRelationship(Vertex type,
Vertex target)
Return if the vertex has a relationship of the type to the target. |
boolean |
hasRelationships()
Return if the relationships have been instantiated. |
void |
incrementAccessCount()
Record that the vertex was accessed, update the access time and increment the access count. |
void |
incrementConsciousnessLevel()
Increase the vertices's level of consciousness. |
void |
incrementConsciousnessLevel(int amount)
Increase the vertices's level of consciousness by the amount. |
boolean |
instanceOf(Primitive type)
Return if the vertex is an instantiation of the primitive type. |
boolean |
instanceOf(Vertex type)
Return if the vertex is an instantiation of the type. |
boolean |
internalHasRelationship(Vertex type,
Vertex target)
Return if the vertex has a relationship of the type to the target. |
void |
internalRemoveRelationship(Relationship relationship)
Remove the relation. |
void |
inverseAssociateAll(Vertex relationshipType,
Vertex source,
Vertex type)
Associate the source with each of the relationship targets by the type. |
boolean |
is(java.lang.Object data)
Return if the vertex is the vertex for the data. |
boolean |
isEquation()
Return if the vertex is an equation. |
boolean |
isPinned()
Return if the vertex is pinned to memory, and will not be forgotten. |
boolean |
isPrimitive()
Return if the vertex is a system primitive. |
boolean |
isVariable()
Return if the vertex is a variable. |
void |
iterate(VertexIterator iterator)
Iterator over all related vertices to the vertex. |
Vertex |
lastRelationship(Primitive type)
Return the last of the ordered relationship, or null. |
Vertex |
lastRelationship(Primitive type,
int fromLast)
Return the fromLast last of the ordered relationship, or null. |
Vertex |
lastRelationship(Vertex type)
Return the last of the ordered relationship, or null. |
Vertex |
lastRelationship(Vertex type,
int fromLast)
Return the fromLast last of the ordered relationship, or null. |
boolean |
matches(Vertex vertex,
java.util.Map<Vertex,Vertex> matches)
Compare if the two vertices match. |
Vertex |
mostConscious(Primitive type)
Return the target vertex related by the type, with the high consciousness level. |
Vertex |
mostConscious(Primitive type,
float min)
Return the target vertex related by the type, with the high consciousness level and correctness greater than the value. |
Vertex |
mostConscious(Vertex type)
Return the target vertex related by the type, with the high consciousness level. |
Vertex |
mostConscious(Vertex type,
float min)
Return the target vertex related by the type, with the high consciousness level greater than the value. |
Vertex |
mostConscious(Vertex type,
float min,
boolean inverse)
Return the target vertex inversely/negatively related by the type, with the high consciousness level. |
Vertex |
mostConscious(Vertex type,
Vertex classification)
Return the target vertex related by the type, of the classification, with the high consciousness level. |
Relationship |
mostConsciousRelationship(Primitive type)
Return the relationship related by the type, with the high consciousness level. |
Relationship |
mostConsciousRelationship(Primitive type,
float min)
Return the relationship related by the type, with the high consciousness level and correctness greater than the value. |
Relationship |
mostConsciousRelationship(Vertex type)
Return the relationship related by the type, with the high consciousness level. |
Vertex |
mostConsciousTargetOfType(Vertex classification)
Return the most conscious target the vertex has any relationship to that is an instantiation of the classification. |
Vertex |
mostConsciousWithAssoiate(Vertex type,
Vertex associate,
Vertex associateType)
Return the target vertex related by the type, that is also most correctly related to the associate vertex by the relationship. |
Vertex |
nextMostConscious(Primitive type,
Vertex ignoring,
float min)
Return the target vertex related by the type, with the high consciousness level greater than the value. |
Vertex |
nextMostConscious(Vertex type,
Vertex ignoring,
float min)
Return the target vertex related by the type, with the high consciousness level and correctness greater than the value. |
Relationship |
nextMostConsciousRelationship(Primitive type,
Vertex ignoring)
Return the relationship related by the type, with the high consciousness level. |
Relationship |
nextMostConsciousRelationship(Primitive type,
Vertex ignoring,
float min)
Return the relationship related by the type, with the high consciousness level greater than the value. |
Relationship |
nextMostConsciousRelationship(Vertex type,
Vertex ignoring)
Return the relationship related by the type, with the high consciousness level. |
java.util.Iterator<Relationship> |
orderedAllRelationships()
Provides an easier method of traversing all the relations of a vertex. |
java.util.List<Vertex> |
orderedRelations(Primitive primitive)
Return all of the relationships targets of the primitive type, sorted by index. |
java.util.List<Vertex> |
orderedRelations(Vertex relationshipType)
Return all of the relationship targets of the type, sorted by index. |
java.util.List<Relationship> |
orderedRelationships(Primitive primitive)
Return all of the relationships of the primitive type, sorted by index. |
java.util.List<Relationship> |
orderedRelationships(Vertex relationshipType)
Return all of the relationships of the type, sorted by index. |
void |
pinDescendants()
Pin the vertex and all of its descendants into memory. |
void |
removeRelationship(Primitive type,
Primitive target)
Remove the relation of the primitive type from the other vertex. |
void |
removeRelationship(Primitive type,
Vertex target)
Remove the relation of the primitive type from the other vertex. |
void |
removeRelationship(Vertex type,
Vertex target)
Remove the relation of the type from the other vertex. |
void |
setAccessCount(int accessCount)
Set the number of times the vertex has been accessed. |
void |
setAccessDate(java.util.Calendar accessDate)
Set the date the vertex was last accessed. |
void |
setAccessDate(java.util.Date accessDate)
Set the date the vertex was last accessed. |
void |
setConsciousnessLevel(int consciousnessLevel)
Set the vertices's level of consciousness. |
void |
setCreationDate(java.util.Calendar creationDate)
Set the date the vertex was created. |
void |
setCreationDate(java.util.Date creationDate)
Set the date the vertex was created. |
void |
setData(java.lang.Object data)
Allows some piece of data to be associated with the vertex. |
void |
setId(java.lang.Long id)
Set the vertex id. |
void |
setName(java.lang.String name)
Set the name of the vertex. |
void |
setNetwork(Network network)
Set the network the vertex is derived from. |
void |
setOriginal(Vertex original)
Set the original long term vertex the short term vertex was derived from. |
void |
setPinned(boolean pinned)
Set if the vertex should be pinned to memory. |
void |
setRelationship(Primitive type,
Vertex newValue)
Set the relationship, removing the old value. |
void |
setRelationship(Vertex type,
Vertex newValue)
Set the relationship, removing the old value. |
int |
totalRelationships()
Return the total number of all relationships. |
void |
unpinDescendants()
Unpin the vertex and all of its descendants from memory. |
Method Detail |
---|
java.lang.Long getId()
void setId(java.lang.Long id)
java.lang.String getName()
void setName(java.lang.String name)
java.lang.String getDataValue()
java.lang.String getDataType()
java.lang.Object getData()
void setData(java.lang.Object data)
boolean hasData()
boolean hasName()
boolean equalsIgnoreCase(Vertex vertex)
Network getNetwork()
void setNetwork(Network network)
java.util.Calendar getCreationDate()
void setCreationDate(java.util.Calendar creationDate)
void setCreationDate(java.util.Date creationDate)
java.util.Calendar getAccessDate()
void setAccessDate(java.util.Calendar accessDate)
void setAccessDate(java.util.Date accessDate)
int getAccessCount()
void setAccessCount(int accessCount)
void incrementAccessCount()
void incrementConsciousnessLevel()
void incrementConsciousnessLevel(int amount)
void decrementConsciousnessLevel()
void decrementConsciousnessLevel(int amount)
int getConsciousnessLevel()
void setConsciousnessLevel(int consciousnessLevel)
boolean isPinned()
void setPinned(boolean pinned)
void pinDescendants()
void unpinDescendants()
boolean hasRelationships()
java.util.List<Relationship> orderedRelationships(Primitive primitive)
java.util.List<Relationship> orderedRelationships(Vertex relationshipType)
java.util.List<Vertex> orderedRelations(Primitive primitive)
java.util.List<Vertex> orderedRelations(Vertex relationshipType)
Vertex getRelationship(Primitive type)
Vertex getRelationship(Vertex type)
java.util.Collection<Relationship> getRelationships(Primitive type)
Relationship getRelationship(Primitive type, Primitive target)
Relationship getRelationship(Primitive type, Vertex target)
Relationship getRelationship(Vertex type, Vertex target)
java.util.Collection<Relationship> getRelationships(Vertex relationshipType)
Vertex lastRelationship(Vertex type)
void fixRelationships(Vertex type)
Vertex lastRelationship(Vertex type, int fromLast)
Vertex lastRelationship(Primitive type, int fromLast)
Vertex lastRelationship(Primitive type)
Vertex mostConscious(Vertex type)
Vertex mostConscious(Primitive type)
Vertex mostConscious(Vertex type, float min)
Relationship mostConsciousRelationship(Primitive type)
Relationship mostConsciousRelationship(Primitive type, float min)
Relationship mostConsciousRelationship(Vertex type)
Vertex mostConscious(Primitive type, float min)
Vertex nextMostConscious(Vertex type, Vertex ignoring, float min)
Relationship nextMostConsciousRelationship(Vertex type, Vertex ignoring)
Relationship nextMostConsciousRelationship(Primitive type, Vertex ignoring)
Relationship nextMostConsciousRelationship(Primitive type, Vertex ignoring, float min)
Vertex nextMostConscious(Primitive type, Vertex ignoring, float min)
Vertex mostConscious(Vertex type, Vertex classification)
Vertex mostConscious(Vertex type, float min, boolean inverse)
Vertex mostConsciousWithAssoiate(Vertex type, Vertex associate, Vertex associateType)
void associateAll(Vertex relationshipType, Vertex target, Vertex type)
void inverseAssociateAll(Vertex relationshipType, Vertex source, Vertex type)
java.util.Map<Vertex,java.util.Map<Relationship,Relationship>> getRelationships()
java.util.Iterator<Relationship> allRelationships()
void iterate(VertexIterator iterator)
int totalRelationships()
java.util.Iterator<Relationship> orderedAllRelationships()
Relationship addRelationship(Primitive type, Primitive target)
Relationship addRelationship(Primitive type, Vertex target)
Relationship addRelationship(Vertex type, Vertex target)
Relationship addRelationship(Vertex type, Vertex target, int index, boolean internal)
Relationship addWeakRelationship(Primitive type, Vertex target, float correctnessMultiplier)
Relationship addWeakRelationship(Vertex type, Vertex target, float correctnessMultiplier)
Relationship addRelationship(Primitive type, Vertex target, int index)
Relationship addRelationship(Primitive type, Primitive target, int index)
Relationship addRelationship(Vertex type, Vertex target, int index)
Relationship addRelationship(Relationship relationship, boolean internal)
void removeRelationship(Vertex type, Vertex target)
void removeRelationship(Primitive type, Vertex target)
void removeRelationship(Primitive type, Primitive target)
void setRelationship(Primitive type, Vertex newValue)
void setRelationship(Vertex type, Vertex newValue)
void internalRemoveRelationship(Relationship relationship)
boolean internalHasRelationship(Vertex type, Vertex target)
Vertex applyQuotient(java.util.Map<Vertex,Vertex> variables)
boolean matches(Vertex vertex, java.util.Map<Vertex,Vertex> matches)
boolean collectMatches(Vertex vertex, java.util.Map<Vertex,java.util.Set<Vertex>> matches)
boolean isPrimitive()
boolean is(java.lang.Object data)
boolean instanceOf(Primitive type)
boolean instanceOf(Vertex type)
boolean isVariable()
boolean isEquation()
boolean hasRelationship(Primitive type)
boolean hasRelationship(Primitive type, Primitive target)
boolean hasRelationship(Primitive type, Vertex target)
boolean hasRelationship(Vertex type, Vertex target)
boolean hasRelationship(Vertex type)
boolean hasAnyRelationshipToTarget(Vertex target)
boolean hasAnyRelationshipToTargetOfType(Vertex classification)
Vertex mostConsciousTargetOfType(Vertex classification)
boolean hasInverseRelationship(Vertex type, Vertex target)
java.lang.String description()
void setOriginal(Vertex original)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |