

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object org.pandora.knowledge.BasicVertex
public class BasicVertex
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.
Field Summary  

static java.lang.String 
SELF

Constructor Summary  

BasicVertex()


BasicVertex(java.lang.Object data)


BasicVertex(Vertex original)
Create the vertex as a clone of the original. 
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(Relationship relationship,
boolean internal,
boolean init,
float correctnessMultiplier)
Add the relation ensuring uniqueness. 
Relationship 
addRelationship(Vertex type,
Vertex target)
Add the relation of the relationship type to the target 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 relationship type to the target 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 all types 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>> variables)
Compare if the two vertices match. 
int 
compare(Vertex vertex)
Compare if the two vertices match. 
static java.lang.String 
convertDataType(java.lang.Object data)

static java.lang.String 
convertDataValue(java.lang.Object data)

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 
equals(java.lang.Object object)
Two vertices are equal if they have the same data. 
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()
Return the data value that the vertex represents. 
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 of the type primitive to the target. 
Relationship 
getRelationship(Primitive type,
Vertex target)
Return the relationship of the type primitive to the target. 
Vertex 
getRelationship(Vertex type)
Return any relationship target of the type. 
Relationship 
getRelationship(Vertex type,
Vertex target)
Return the relationship of the type primitive to the target. 
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 of the 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()
Return if the vertex has a data value that it represents. 
int 
hashCode()
Hash first on data then id for equality compatibility. 
boolean 
hasInverseRelationship(Vertex type,
Vertex target)
Return if the vertex has an inverse 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 (noninverse) 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 relationship. 
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 data is equal to the data. 
boolean 
isEquation()
Return if the vertex is a 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 fromLast last of the ordered relationship, or null. 
Vertex 
lastRelationship(Primitive type,
int fromLast)
Return the 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> variables)
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 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 related by the type, with the high consciousness level greater than the value. 
Vertex 
mostConscious(Vertex type,
Vertex classification)
Return the target vertex related by the type, 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 correctness)
Return the relationship related by the type, with the high consciousness level. 
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 greater than the value. 
Vertex 
nextMostConscious(Vertex type,
Vertex ignoring,
float min,
boolean inverse)
Return the target vertex inversely/negatively related by the type, with the high consciousness level. 
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 target vertex 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. 
Relationship 
nextMostConsciousRelationship(Vertex type,
Vertex ignoring,
float min,
boolean inverse)
Return the target vertex inversely/negatively related by the type, with the high consciousness level. 
java.util.Iterator<Relationship> 
orderedAllRelationships()
Provides an easier method of traversing all the relations of all types 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 relationship of the relation primitive type to the target vertex. 
void 
removeRelationship(Primitive type,
Vertex target)
Remove the relationship of the relation primitive type to the target vertex. 
void 
removeRelationship(Relationship relationship)
Remove the relationship. 
void 
removeRelationship(Vertex type,
Vertex target)
Remove the relationship of the relation type to the target 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)
Set the data value that the vertex represents. 
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. 
java.lang.String 
toString()

int 
totalRelationships()
Return the total number of all relationships. 
void 
unpinDescendants()
Unpin the vertex and all of its descendants from memory. 
static void 
writeHeader(Vertex vertex,
java.io.PrintWriter writer)

Methods inherited from class java.lang.Object 

getClass, notify, notifyAll, wait, wait, wait 
Field Detail 

public static java.lang.String SELF
Constructor Detail 

public BasicVertex()
public BasicVertex(java.lang.Object data)
public BasicVertex(Vertex original)
Method Detail 

public void setOriginal(Vertex original)
setOriginal
in interface Vertex
public Network getNetwork()
getNetwork
in interface Vertex
public void setNetwork(Network network)
setNetwork
in interface Vertex
public java.util.Calendar getCreationDate()
getCreationDate
in interface Vertex
public void setCreationDate(java.util.Calendar creationDate)
setCreationDate
in interface Vertex
public void setCreationDate(java.util.Date creationDate)
setCreationDate
in interface Vertex
public java.util.Calendar getAccessDate()
getAccessDate
in interface Vertex
public void setAccessDate(java.util.Calendar accessDate)
setAccessDate
in interface Vertex
public void setAccessDate(java.util.Date accessDate)
setAccessDate
in interface Vertex
public int getAccessCount()
getAccessCount
in interface Vertex
public void setAccessCount(int accessCount)
setAccessCount
in interface Vertex
public void incrementAccessCount()
incrementAccessCount
in interface Vertex
public void incrementConsciousnessLevel()
incrementConsciousnessLevel
in interface Vertex
public void decrementConsciousnessLevel()
decrementConsciousnessLevel
in interface Vertex
public void decrementConsciousnessLevel(int amount)
decrementConsciousnessLevel
in interface Vertex
public void incrementConsciousnessLevel(int amount)
incrementConsciousnessLevel
in interface Vertex
public int getConsciousnessLevel()
getConsciousnessLevel
in interface Vertex
public void setConsciousnessLevel(int consciousnessLevel)
setConsciousnessLevel
in interface Vertex
public Relationship addRelationship(Primitive type, Primitive target)
addRelationship
in interface Vertex
public Relationship addRelationship(Primitive type, Vertex target)
addRelationship
in interface Vertex
public Relationship addRelationship(Vertex type, Vertex target)
addRelationship
in interface Vertex
public Relationship addRelationship(Primitive type, Vertex target, int index)
addRelationship
in interface Vertex
public Relationship addRelationship(Primitive type, Primitive target, int index)
addRelationship
in interface Vertex
public Relationship addRelationship(Vertex type, Vertex target, int index)
addRelationship
in interface Vertex
public Relationship addRelationship(Vertex type, Vertex target, int index, boolean internal)
addRelationship
in interface Vertex
public Relationship addWeakRelationship(Primitive type, Vertex target, float correctnessMultiplier)
addWeakRelationship
in interface Vertex
public Relationship addWeakRelationship(Vertex type, Vertex target, float correctnessMultiplier)
addWeakRelationship
in interface Vertex
public Relationship addRelationship(Relationship relationship, boolean internal)
addRelationship
in interface Vertex
public Relationship addRelationship(Relationship relationship, boolean internal, boolean init, float correctnessMultiplier)
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public boolean equalsIgnoreCase(Vertex vertex)
equalsIgnoreCase
in interface Vertex
public java.lang.Long getId()
Vertex
getId
in interface Vertex
public void setId(java.lang.Long id)
setId
in interface Vertex
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object getData()
getData
in interface Vertex
public void setData(java.lang.Object data)
setData
in interface Vertex
public boolean hasData()
hasData
in interface Vertex
public boolean hasRelationships()
hasRelationships
in interface Vertex
public java.util.Map<Vertex,java.util.Map<Relationship,Relationship>> getRelationships()
getRelationships
in interface Vertex
public Vertex applyQuotient(java.util.Map<Vertex,Vertex> variables)
applyQuotient
in interface Vertex
public boolean matches(Vertex vertex, java.util.Map<Vertex,Vertex> variables)
matches
in interface Vertex
public boolean collectMatches(Vertex vertex, java.util.Map<Vertex,java.util.Set<Vertex>> variables)
collectMatches
in interface Vertex
public int compare(Vertex vertex)
public void fixRelationships(Vertex type)
fixRelationships
in interface Vertex
public int totalRelationships()
totalRelationships
in interface Vertex
public Vertex getRelationship(Primitive type)
getRelationship
in interface Vertex
public Vertex getRelationship(Vertex type)
getRelationship
in interface Vertex
public java.util.Collection<Relationship> getRelationships(Primitive type)
getRelationships
in interface Vertex
public java.util.Collection<Relationship> getRelationships(Vertex relationshipType)
getRelationships
in interface Vertex
public Vertex lastRelationship(Vertex type)
lastRelationship
in interface Vertex
public Vertex lastRelationship(Vertex type, int fromLast)
lastRelationship
in interface Vertex
public Vertex lastRelationship(Primitive type)
lastRelationship
in interface Vertex
public Vertex lastRelationship(Primitive type, int fromLast)
lastRelationship
in interface Vertex
public java.util.List<Relationship> orderedRelationships(Primitive primitive)
orderedRelationships
in interface Vertex
public java.util.List<Relationship> orderedRelationships(Vertex relationshipType)
orderedRelationships
in interface Vertex
public java.util.List<Vertex> orderedRelations(Primitive primitive)
orderedRelations
in interface Vertex
public java.util.List<Vertex> orderedRelations(Vertex relationshipType)
orderedRelations
in interface Vertex
public Vertex mostConscious(Vertex type, float min)
mostConscious
in interface Vertex
public Relationship mostConsciousRelationship(Vertex type)
mostConsciousRelationship
in interface Vertex
public Relationship nextMostConsciousRelationship(Vertex type, Vertex ignoring)
nextMostConsciousRelationship
in interface Vertex
public Relationship mostConsciousRelationship(Primitive type)
mostConsciousRelationship
in interface Vertex
public Relationship mostConsciousRelationship(Primitive type, float correctness)
mostConsciousRelationship
in interface Vertex
public Relationship nextMostConsciousRelationship(Primitive type, Vertex ignoring)
nextMostConsciousRelationship
in interface Vertex
public Vertex mostConscious(Primitive type, float min)
mostConscious
in interface Vertex
public Vertex mostConscious(Vertex type, float min, boolean inverse)
mostConscious
in interface Vertex
public Vertex nextMostConscious(Primitive type, Vertex ignoring, float min)
nextMostConscious
in interface Vertex
public Relationship nextMostConsciousRelationship(Primitive type, Vertex ignoring, float min)
nextMostConsciousRelationship
in interface Vertex
public Vertex nextMostConscious(Vertex type, Vertex ignoring, float min)
nextMostConscious
in interface Vertex
public Vertex mostConscious(Primitive type)
mostConscious
in interface Vertex
public Vertex mostConscious(Vertex type)
mostConscious
in interface Vertex
public Vertex nextMostConscious(Vertex type, Vertex ignoring, float min, boolean inverse)
public Relationship nextMostConsciousRelationship(Vertex type, Vertex ignoring, float min, boolean inverse)
public Vertex mostConsciousTargetOfType(Vertex classification)
mostConsciousTargetOfType
in interface Vertex
public Vertex mostConscious(Vertex type, Vertex classification)
mostConscious
in interface Vertex
public Vertex mostConsciousWithAssoiate(Vertex type, Vertex associate, Vertex associateType)
mostConsciousWithAssoiate
in interface Vertex
public void associateAll(Vertex relationshipType, Vertex target, Vertex type)
associateAll
in interface Vertex
public void inverseAssociateAll(Vertex relationshipType, Vertex source, Vertex type)
inverseAssociateAll
in interface Vertex
public void removeRelationship(Vertex type, Vertex target)
removeRelationship
in interface Vertex
public void removeRelationship(Primitive type, Vertex target)
removeRelationship
in interface Vertex
public void removeRelationship(Primitive type, Primitive target)
removeRelationship
in interface Vertex
public void removeRelationship(Relationship relationship)
public void internalRemoveRelationship(Relationship relationship)
internalRemoveRelationship
in interface Vertex
public void setRelationship(Primitive type, Vertex newValue)
setRelationship
in interface Vertex
public void setRelationship(Vertex type, Vertex newValue)
setRelationship
in interface Vertex
public java.util.Iterator<Relationship> allRelationships()
allRelationships
in interface Vertex
public void iterate(VertexIterator iterator)
iterate
in interface Vertex
public void pinDescendants()
pinDescendants
in interface Vertex
public void unpinDescendants()
unpinDescendants
in interface Vertex
public java.util.Iterator<Relationship> orderedAllRelationships()
orderedAllRelationships
in interface Vertex
public static void writeHeader(Vertex vertex, java.io.PrintWriter writer)
public boolean isPrimitive()
isPrimitive
in interface Vertex
public boolean isVariable()
isVariable
in interface Vertex
public boolean isEquation()
isEquation
in interface Vertex
public boolean is(java.lang.Object data)
is
in interface Vertex
public boolean instanceOf(Primitive type)
instanceOf
in interface Vertex
public boolean instanceOf(Vertex type)
instanceOf
in interface Vertex
public boolean hasRelationship(Primitive type)
hasRelationship
in interface Vertex
public boolean hasRelationship(Primitive type, Primitive target)
hasRelationship
in interface Vertex
public boolean hasRelationship(Primitive type, Vertex target)
hasRelationship
in interface Vertex
public Relationship getRelationship(Primitive type, Vertex target)
getRelationship
in interface Vertex
public Relationship getRelationship(Primitive type, Primitive target)
getRelationship
in interface Vertex
public boolean hasRelationship(Vertex type, Vertex target)
hasRelationship
in interface Vertex
public Relationship getRelationship(Vertex type, Vertex target)
getRelationship
in interface Vertex
public boolean internalHasRelationship(Vertex type, Vertex target)
internalHasRelationship
in interface Vertex
public boolean hasRelationship(Vertex type)
hasRelationship
in interface Vertex
public boolean hasAnyRelationshipToTarget(Vertex target)
hasAnyRelationshipToTarget
in interface Vertex
public boolean hasAnyRelationshipToTargetOfType(Vertex classification)
hasAnyRelationshipToTargetOfType
in interface Vertex
public boolean hasInverseRelationship(Vertex type, Vertex target)
hasInverseRelationship
in interface Vertex
public java.lang.String description()
Vertex
description
in interface Vertex
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getDataType()
Vertex
getDataType
in interface Vertex
public java.lang.String getDataValue()
Vertex
getDataValue
in interface Vertex
public static java.lang.String convertDataValue(java.lang.Object data)
public static java.lang.String convertDataType(java.lang.Object data)
public java.lang.String getName()
getName
in interface Vertex
public void setName(java.lang.String name)
setName
in interface Vertex
public boolean hasName()
hasName
in interface Vertex
public boolean isPinned()
isPinned
in interface Vertex
public void setPinned(boolean pinned)
setPinned
in interface Vertex


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 