aminePlatform.kernel.ontology
Class CSRule

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

public class CSRule
extends CS
implements java.io.Serializable

Title: CSRule Class

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
CSRule()
          Create an 'empty' CS Rule
CSRule(java.lang.Object antecedent)
          Create a new CSRule with the specified antecedent.
CSRule(java.lang.Object antecedent, java.lang.Object consequence)
          Create a new CSRule with the specified antecedent and consequence.
 
Method Summary
 void clear()
          Clear the content of the current CSRule
 void finalize()
          clear the fathers and children lists as well as the description of the current CS.
 java.lang.Object getAntecedent()
          Get the antecedent of the current CSRule.
 java.lang.Object getConsequence()
          Get the consequence of the current CSRule.
static boolean isCSRule(java.lang.Object obj)
          Check if the specified Object obj is a CSRule
 void removeAntecedent()
          Remove the antecedent of the current CSRule.
 void removeConsequence()
          Remove the description of the consequence of the current CSRule.
 void setAntecedent(java.lang.Object antecedent)
          Set the antecedent of the current CSRule to the specified antecedent.
 void setConsequence(java.lang.Object description)
          Set the consequence of the current CSRule to description.
protected  org.jdom.Element toContent(Ontology ontology)
          For the current Regle add the element that specifies its content to the XML ontology document.
protected  org.jdom.Element toCSKind(java.lang.String key)
          For the current CSRule add the element that specifies its kind to the XML ontology document.
 java.lang.String toString(Lexicon lexicon)
          Implement the method toString(Lexicon) specified in the interface ToString.
 
Methods inherited from class aminePlatform.kernel.ontology.CS
addCSRule, addCSRule, addIncomeEdge, addOutcomeEdge, addSituation, canBeRemoved, copyNode, detach, getAdjacentNodes, getArrayOfChildren, getArrayOfFathers, getChildren, getContent, getCSRuleAt, getCSRules, getCSRulesAntecedent, getCSRulesConcequence, getDescription, 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, removeDescription, removeLink, removeLink, removeLinkToSituation, removeSituationAt, setChildren, setDescription, 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

CSRule

public CSRule()
Create an 'empty' CS Rule


CSRule

public CSRule(java.lang.Object antecedent,
              java.lang.Object consequence)
Create a new CSRule with the specified antecedent and consequence.

Parameters:
antecedent - The antecedent of the current CSRule. It could be null.
consequence - The consequence of the current CSRule. It could be null.

CSRule

public CSRule(java.lang.Object antecedent)
Create a new CSRule with the specified antecedent.

Parameters:
antecedent - The antecedent of the current CSRule. It could be null.
Method Detail

finalize

public void finalize()
Description copied from class: CS
clear the fathers and children lists as well as the description of the current CS.

Overrides:
finalize in class CS

clear

public void clear()
Clear the content of the current CSRule

Overrides:
clear in class CS

isCSRule

public static boolean isCSRule(java.lang.Object obj)
Check if the specified Object obj is a CSRule

Parameters:
obj - An object
Returns:
true if obj is a CSRule

getAntecedent

public java.lang.Object getAntecedent()
Get the antecedent of the current CSRule.

Returns:
the antecedent of the current CSRule. The returned object should be casted to a particular description scheme (like CG or any other structure implemented in Java).

setAntecedent

public void setAntecedent(java.lang.Object antecedent)
Set the antecedent of the current CSRule to the specified antecedent.

Parameters:
antecedent - The (new) antecedent of the current CSRule

removeAntecedent

public void removeAntecedent()
Remove the antecedent of the current CSRule.


getConsequence

public java.lang.Object getConsequence()
Get the consequence of the current CSRule.

Returns:
the consequence of the current CSRule. The returned object should be casted to a particular description scheme.

setConsequence

public void setConsequence(java.lang.Object description)
Set the consequence of the current CSRule to description.

Parameters:
description - The (new) description of the consequence of the current CSRule

removeConsequence

public void removeConsequence()
Remove the description of the consequence of the current CSRule.


toString

public java.lang.String toString(Lexicon lexicon)
                          throws ToStringException
Description copied from class: CS
Implement the method toString(Lexicon) specified in the interface ToString. It is in fact overriden in the sub-classes of CS

Specified by:
toString in interface ToString
Overrides:
toString in class CS
Parameters:
lexicon - Lexicon to use for the textual formulation
Returns:
a textual formulation of the current CS
Throws:
ToStringException

toCSKind

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

Overrides:
toCSKind in class CS
Parameters:
key -
Returns:
cselement.

toContent

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

Overrides:
toContent in class CS
Parameters:
ontology -
Returns:
content.