de.dfki.mycbr.core.model
Class AttributeDesc

java.lang.Object
  extended by java.util.Observable
      extended by de.dfki.mycbr.core.model.AttributeDesc
All Implemented Interfaces:
IExplainable, java.util.Observer
Direct Known Subclasses:
ConceptDesc, SimpleAttDesc

public abstract class AttributeDesc
extends java.util.Observable
implements java.util.Observer, IExplainable

The vocabulary of a myCBR project consists of several concepts which describe a tree like structure as a class hierarchy (with composition and inheritance). The classes in this hierarchy are represented by objects of type concept. Each concept contains several attribute descriptions (like integer, float, boolean descriptions ...). Concepts can have sub/super concepts (representing inheritance) and can have concept descriptions as attribute descriptions themselves (representing composition). The structure containing the values (representing object diagrams) is introduced in the package de.dfki.mycbr.core.casebase. This class contains properties that all of these descriptions have in common.

Author:
myCBR Team

Constructor Summary
AttributeDesc(Concept owner, java.lang.String name)
           
 
Method Summary
abstract  boolean canOverride(AttributeDesc desc)
          Checks whether this attribute description can override the given attribute description
 void delete()
           
abstract  void deleteAllFcts()
           
 boolean fits(Attribute att)
          Checks whether the given attribute fits this.
 boolean fitsSingle(Attribute att)
          Checks whether a single attribute fits the constraints for this.
 Attribute getAttribute(java.lang.Object value)
           
 Explainable getExpType()
           
 java.lang.String getName()
           
 Concept getOwner()
          Returns the owner of this description.
 boolean isMultiple()
          Get the value of isMultiple.
 void setMultiple(boolean isMultiple)
          Set the value of isMultiple.
 void setName(java.lang.String name)
           
 void setOwner(Concept owner)
           
 java.lang.String toString()
           
 void update(java.util.Observable o, java.lang.Object arg)
           
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeDesc

public AttributeDesc(Concept owner,
                     java.lang.String name)
              throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

setMultiple

public void setMultiple(boolean isMultiple)
Set the value of isMultiple. The value for this attribute description can be a set of corresponding attribute objects instead of a single value.

Parameters:
isMultiple - the new value of isMultiple

isMultiple

public boolean isMultiple()
Get the value of isMultiple. Possible values for this attribute description can be a set of corresponding attribute objects instead of a single value.

Returns:
the value of isMultiple

setOwner

public void setOwner(Concept owner)
              throws java.lang.Exception
Throws:
java.lang.Exception

getOwner

public Concept getOwner()
Returns the owner of this description. An attribute description belongs to exactly one concept (the owner) at a time. However, it is inherited to the sub concepts of the owner.

Returns:
the unique owner of this description

setName

public void setName(java.lang.String name)
             throws java.lang.Exception
Throws:
java.lang.Exception

getName

public java.lang.String getName()
Specified by:
getName in interface IExplainable
Returns:
the name of this

canOverride

public abstract boolean canOverride(AttributeDesc desc)
Checks whether this attribute description can override the given attribute description


getAttribute

public Attribute getAttribute(java.lang.Object value)
                       throws java.text.ParseException
Parameters:
value -
Returns:
the attribute associated with the given value
Throws:
java.text.ParseException

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer

fits

public boolean fits(Attribute att)
Checks whether the given attribute fits this. Be aware that if this is multiple then single values will not fit. For checking whether single values fit this description without taking multiple values into account call fitsSingle(Attribute)

Parameters:
att - the attribute to be checked
Returns:
true if the attribute fits this, false otherwise

fitsSingle

public boolean fitsSingle(Attribute att)
Checks whether a single attribute fits the constraints for this. Returns true, if att is a valid SpecialAttribute or if att can be used as a single value of a multiple attribute. If this is not multiple calls fits(Attribute)

Parameters:
att - the attribute which should be checked
Returns:
true, when att can be used as value of this or in multiple attribute

delete

public void delete()

deleteAllFcts

public abstract void deleteAllFcts()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getExpType

public Explainable getExpType()
Specified by:
getExpType in interface IExplainable
Returns:
the type of this