aminePlatform.kernel.ontology
Class Context

java.lang.Object
  extended byaminePlatform.kernel.ontology.CS
      extended byaminePlatform.kernel.ontology.Situation
          extended byaminePlatform.kernel.ontology.Context
All Implemented Interfaces:
Node, java.io.Serializable, ToString

public class Context
extends Situation
implements java.io.Serializable

Title : ontology.Context Class

Description : A Context is a kind of Situation that is embedded in a description. As a Context, a Situation will play an identical abstraction role as type and individual: [Eat], [Eat :eat1], [Eat =c1] and c1 is a Context Node like Eat (which is a Type node) and eat1 (which is an Individual node). The many advantage and the enhance of the expressive power that is gained with the addition of Context CS is illustrated especially by the addition and integration of complex structures in Amine Ontology.

Copyright: Copyright (c) Adil KABBAJ, 2004-2009

See Also:
Serialized Form

Field Summary
 
Fields inherited from class aminePlatform.kernel.ontology.CS
S_CONTEXT, S_CSRULE, S_SITUATION, S_TYPE
 
Constructor Summary
Context(CS subject)
           
Context(CS subject, java.lang.Object description)
           
 
Method Summary
 java.util.Enumeration getDirectSuperContexts()
          Get the direct super contexts of the current Context.
protected  void getImmSuperContexts(java.util.ArrayList imdtSuperContexts)
           
 Context getMinComSuperContext(Context context2)
          For both minComSuperContext and maxComSubContext, a progressive breadth-first traversal of the ontology is done to get super(sub)contexts of both the current Context and the parameter Context context2.
 CS getSubject()
          Get the subject of the current Context.
 Type getType()
           
static boolean isContext(java.lang.Object obj)
          Check if the specified Object obj is a Context CS
 void setSubject(CS subject)
          Set the specified subject as the subject of the current Context
protected  org.jdom.Element toContent(Ontology ontology)
          For the current Context add the element that specifies its content to the XML ontology document.
protected  org.jdom.Element toCSKind(java.lang.String key)
          For the current context add the element that specifies its kind to the XML ontology document.
 
Methods inherited from class aminePlatform.kernel.ontology.Situation
getDescription, getIndexingTypes, isSituation, removeDescription, setDescription, toString
 
Methods inherited from class aminePlatform.kernel.ontology.CS
addCSRule, addCSRule, addIncomeEdge, addOutcomeEdge, addSituation, canBeRemoved, clear, copyNode, detach, finalize, getAdjacentNodes, getArrayOfChildren, getArrayOfFathers, getChildren, getContent, getCSRuleAt, getCSRules, getCSRulesAntecedent, getCSRulesConcequence, getEdges, getFathers, getImmSubTypes, getImmSuperTypes2, getIncomeEdges, getLeftTopPoint, getMetaphors, getNbrChildren, getNbrCSRules, getNbrFathers, getNbrSituations, getNumberofEdges, getOutcomeEdges, getSituationAt, getSituations, getSituationsDescription, hasContentToDisplay, isAntecedent, isChild, isConceptType, isContext, isCS, isCSRule, isDescendant, isFather, isIndexedType, isIndividual, isMetaphor, isRelationType, isSituation, isType, link, removeCSRuleAt, removeLink, removeLink, removeLinkToSituation, removeSituationAt, setChildren, setFathers, setIncomeEdges, setLeftTopPoint, setOutcomeEdges, setRectangle, toChildren, toDisplayString, toFathers, toLexicon, toXml
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Context

public Context(CS subject)

Context

public Context(CS subject,
               java.lang.Object description)
Method Detail

isContext

public static boolean isContext(java.lang.Object obj)
Check if the specified Object obj is a Context CS

Parameters:
obj - An object
Returns:
true if obj is a Context CS

getSubject

public CS getSubject()
Get the subject of the current Context.

Returns:
a CS : the subject of the Context.

getType

public Type getType()

setSubject

public void setSubject(CS subject)
Set the specified subject as the subject of the current Context


getMinComSuperContext

public Context getMinComSuperContext(Context context2)
For both minComSuperContext and maxComSubContext, a progressive breadth-first traversal of the ontology is done to get super(sub)contexts of both the current Context and the parameter Context context2. At each step (i.e. development of the next level), we check if the two arrays super(sub)Contexts have a common context. To avoid redundant comparisons, the elements of the first array correspond to couples : when we scan the first array and check for each element if it is contained also in the second array, we record in Index the index in the second array to indicate that the search has been done from the start of the second array to the element with the index and thus we avoid this search in the next check; we look only at the elements of the second array that come after the element at the index position.

Parameters:
context2 - A Context
Returns:
the minimal common supercontext (a Context CS) of the current Context and context2 (the parameter). Return null if context2 is null or unknown or if there is no minimal common supercontext for the current Context and context2.

getDirectSuperContexts

public java.util.Enumeration getDirectSuperContexts()
Get the direct super contexts of the current Context. Note that direct superContexts of a Context does not correspond (always) to its fathers list; a father could be a situation and in this case this father is not considered as a superContext.

Returns:
an Enumeration over an ArrayList of Context CSs that corresponds to the direct super contexts of the current Context. Return null if the current Context has no superContexts.

getImmSuperContexts

protected void getImmSuperContexts(java.util.ArrayList imdtSuperContexts)

toCSKind

protected org.jdom.Element toCSKind(java.lang.String key)
For the current context add the element that specifies its kind to the XML ontology document.

Overrides:
toCSKind in class Situation
Returns:
cselement.

toContent

protected org.jdom.Element toContent(Ontology ontology)
For the current Context add the element that specifies its content to the XML ontology document.

Overrides:
toContent in class Situation
Returns:
content.