UKS
Loading...
Searching...
No Matches
UKS.Thing Class Reference

In the lexicon of graphs, a Thing is a "node". A Thing can represent anything, physical object, attribute, word, action, etc. More...

Public Member Functions

override string ToString ()
 Returns a Thing's label don't delete this ToString because the debugger uses it when mousing over a Thing.
 
string ToString (bool showProperties=false)
 Formats a displayable Thing as a string.
 
IList< ThingAncestorList ()
 
bool HasAncestorLabeled (string label)
 Determines whether a Thing has a specific ancestor.
 
bool HasAncestor (Thing t)
 Determines whether a Thing has a specific ancestor.
 
int GetDescendentsCount ()
 Determines how many descendants a Thing has.
 
IList< ThingDescendentsList ()
 Returns a list of all of a thing's descendandants. CAUTION: this may be large and time-consuming.
 
void SetFired (Thing t=null)
 Updates the last-fired time on a Thing.
 
Relationship AddRelationship (Thing target, Thing relationshipType)
 Adds a relationship to a Thing if it does not already exist. The Thing is the source of the relationship.
 
void RemoveRelationship (Relationship r)
 Removes a relationship.
 
Relationship HasRelationship (Thing t)
 
Thing HasRelationshipWithParent (Thing t)
 
Thing HasRelationshipWithAncestorLabeled (string s)
 
void RemoveRelationship (Thing t2, Thing relationshipType)
 
List< RelationshipGetRelationshipsWithAncestor (Thing t)
 
List< RelationshipGetRelationshipByWithAncestor (Thing t)
 
void AddParent (Thing newParent)
 Addsa a parent to a Thing.
 
void RemoveParent (Thing t)
 Remove a parent from a Thing.
 
Relationship AddChild (Thing t)
 
void RemoveChild (Thing t)
 
bool HasPropertyLabeled (string label)
 

Public Attributes

int useCount = 0
 
DateTime lastFiredTime = new()
 

Properties

IList< RelationshipRelationshipsNoCount [get]
 Only used by the tree control.
 
List< RelationshipRelationshipsWriteable [get]
 Get an "unsafe" writeable list of a Thing's Relationships. This list may change while it is in use and so should not be used as a foreach iterator.
 
IList< RelationshipRelationshipsFrom [get]
 Get a "safe" list of relationships which target this Thing.
 
List< RelationshipRelationshipsFromWriteable [get]
 Get an "unsafe" writeable list of Relationships which target this Thing.
 
List< RelationshipRelationshipsAsTypeWriteable [get]
 Get an "unsafe" writeable list of Relationships for which this Thing is the relationship type.
 
object V [get, set]
 Any serializable object can be attached to a Thing.
 
string Label [get, set]
 Manages a Thing's label and maintais a hash table.
 
IList< ThingParents [get]
 "Safe" list of direct ancestors
 
IList< ThingChildren [get]
 "Safe" list of direct descendants
 
IList< RelationshipRelationships [get]
 Full "Safe" list or relationships.
 
IEnumerable< ThingAncestors [get]
 Recursively gets all the ancestors of a Thing.
 
IEnumerable< ThingDescendents [get]
 Rrecursively gets all descendents of a Thing. Use with caution as this might be a large list.
 
static Thing HasChild [get]
 

Detailed Description

In the lexicon of graphs, a Thing is a "node". A Thing can represent anything, physical object, attribute, word, action, etc.

Member Function Documentation

◆ AddParent()

void UKS.Thing.AddParent ( Thing newParent)
inline

Addsa a parent to a Thing.

Parameters
newParent

◆ AddRelationship()

Relationship UKS.Thing.AddRelationship ( Thing target,
Thing relationshipType )
inline

Adds a relationship to a Thing if it does not already exist. The Thing is the source of the relationship.

Parameters
targetTarget Thing
relationshipTypeRelatinoshipType Thing
Returns
the new or existing Relationship

◆ DescendentsList()

IList< Thing > UKS.Thing.DescendentsList ( )
inline

Returns a list of all of a thing's descendandants. CAUTION: this may be large and time-consuming.

Returns

◆ GetDescendentsCount()

int UKS.Thing.GetDescendentsCount ( )
inline

Determines how many descendants a Thing has.

Returns
the count

◆ HasAncestor()

bool UKS.Thing.HasAncestor ( Thing t)
inline

Determines whether a Thing has a specific ancestor.

Parameters
label
Returns

◆ HasAncestorLabeled()

bool UKS.Thing.HasAncestorLabeled ( string label)
inline

Determines whether a Thing has a specific ancestor.

Parameters
label
Returns

◆ RemoveParent()

void UKS.Thing.RemoveParent ( Thing t)
inline

Remove a parent from a Thing.

Parameters
tIf the Thing is not a parent, the function does nothing

◆ RemoveRelationship()

void UKS.Thing.RemoveRelationship ( Relationship r)
inline

Removes a relationship.

Parameters
rThe Relationship's source neede not be this Thing

◆ SetFired()

void UKS.Thing.SetFired ( Thing t = null)
inline

Updates the last-fired time on a Thing.

Parameters
toptional: may select a different Thing

◆ ToString() [1/2]

override string UKS.Thing.ToString ( )
inline

Returns a Thing's label don't delete this ToString because the debugger uses it when mousing over a Thing.

Returns
the Thing's label

◆ ToString() [2/2]

string UKS.Thing.ToString ( bool showProperties = false)
inline

Formats a displayable Thing as a string.

Parameters
showPropertiesAppends a parenthetical list of relationships to the label
Returns
The string to display

The documentation for this class was generated from the following files: