|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
de.dfki.mycbr.core.model.Concept
de.dfki.mycbr.core.Project
public final class Project
A Project consists of a vocabulary and (possibly several) case bases. The vocabulary builds the model and consists of a concept hierarchy, the attribute descriptions of each concept and the corresponding similarity measures. It can be exported/imported via objects of classes that implement IImporter/ IExporter.
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_FCT_NAME
predefined constants for special values. |
static java.lang.String |
DEFAULT_FCT_NAME_TMP
predefined constants for special values. |
static java.lang.String |
ID_DEFAULT
predefined constants for special values. |
static java.lang.String |
NO_SPECIAL_VALUE
predefined constants for special values. |
static java.lang.String |
UNDEFINED_SPECIAL_ATTRIBUTE
predefined constants for special values. |
static java.lang.String |
UNKNOWN_SPECIAL_VALUE
predefined constants for special values. |
| Constructor Summary | |
|---|---|
Project()
Default constructor. |
|
Project(java.lang.String path)
Constructor for project from file. |
|
| Method Summary | |
|---|---|
void |
addAttributeDesc(AttributeDesc desc)
Adds given description as attribute description to current c description. |
TaxonomyFct |
addInhFct(java.lang.String name)
Creates a new InheritanceFct for myCBR's model. |
void |
addPartOfRelation(ConceptDesc desc)
Adds desc as a part of relation of this concept. |
void |
addSpecialValue(java.lang.String value)
|
Similarity |
calculateMultipleAttributeSimilarity(java.lang.Object simFct,
MultipleAttribute<?> att1,
MultipleAttribute<?> att2)
Calculates the similarity of the given MultipleAttribute objects
based on the given similarity function. |
Similarity |
calculateSpecialSimilarity(Attribute att1,
Attribute att2)
Calculates the similarity of the given attributes by calling the calculateSimilarity method of the appropriate similarity function. |
boolean |
canOverride(Concept c)
|
void |
cleanInstances(Concept c,
AttributeDesc desc)
Cleans all instances known for concept c. |
DefaultCaseBase |
createDefaultCB(java.lang.String name)
Tries to create a default case base for this project. |
DefaultCaseBase |
createDefaultCB(java.lang.String cbName,
int currentCBCount)
Used to speed up the import of case bases if the number of cases is known. |
Concept |
createTopConcept(java.lang.String id)
Adds a new top c with the specified name to this project. |
void |
delete()
Deletes the concept with the given ID from this model |
ICaseBase |
deleteCaseBase(java.lang.String name)
Removes the case base specified by name from this project. |
void |
deletePartOfRelation(ConceptDesc desc)
Removes the given description as part-of relation. |
java.util.HashMap<java.lang.String,AttributeDesc> |
getAllAttributeDescs()
Gets the attribute descriptions of this c including inherited attributes. |
java.util.Collection<Instance> |
getAllInstances()
Returns all instances that are known for this project. |
java.util.LinkedList<AttributeDesc> |
getAttDescsByName(java.lang.String name)
Returns a list of attribute descriptions with the given name. |
java.util.HashMap<java.lang.String,AttributeDesc> |
getAttributeDescs()
Gets the attribute descriptions of this c Be aware that the inherited attribute descriptions are not returned by this method. |
java.lang.String |
getAuthor()
Gets the author of this project. |
java.util.HashMap<java.lang.String,ICaseBase> |
getCaseBases()
Gets the case bases for this project. |
ICaseBase |
getCB(java.lang.String name)
Returns the case base associated with the given name. |
Concept |
getConceptByID(java.lang.String id)
Returns the c description with the given name. |
int |
getCurrentNumberOfCases()
Returns the number of cases that have been imported so far. |
ExplanationManager |
getExplanationManager()
|
java.lang.String |
getExtension()
Returns the zip file's extension. |
TaxonomyFct |
getInhFct()
Returns the inheritance function of this c. |
Instance |
getInstance(java.lang.String name)
Returns the instance of this with name name and null if there is none. |
Similarity |
getLocalSimilarity(Attribute a,
Attribute b,
AttributeDesc desc)
For displaying local similarities. |
java.util.Vector<ConceptDesc> |
getPartOfRelations()
Returns all part-of relation known for this concept. |
java.lang.String |
getPath()
Gets the path of this project. |
Project |
getProject()
Returns the current project. |
Attribute |
getSpecialAttribute(java.lang.String obj)
Returns the SpecialAttribute object corresponding to
the given string. |
SymbolFct |
getSpecialFct()
Returns the special function of this project. |
SpecialDesc |
getSpecialValueDesc()
|
Concept |
getSuperConcept()
|
int |
getTotalNumberOfCases()
The total number of cases that have to be imported is given by this project's .myCBR file. |
boolean |
hasCB(java.lang.String name)
Checks whether there is a case base with the given name. |
java.lang.Boolean |
hasConceptWithID(java.lang.String id)
Checks whether there is a c description in the current inheritance hierarchy which has the specified name. |
boolean |
isImporting()
Checks whether the import of this project is still running. |
boolean |
isSpecialAttribute(java.lang.String obj)
|
boolean |
removeAttributeDesc(java.lang.String name)
Removes the attribute given by name from the attributes of this c. |
void |
removeCase(java.lang.String name)
Removes the case with the given name from each case base. |
Concept |
removeSubConcept(java.lang.String name)
Removes the sub concept with name name. |
void |
save()
Loads the project from the given file. |
void |
setAuthor(java.lang.String author)
Sets the author of this project. |
void |
setInhFct(SpecialFct f)
Changes the active special value function. |
void |
setPath(java.lang.String path)
Sets the project's path to the specified path. |
void |
setSpecialValueFct(SpecialFct f)
Changes the active special function. |
void |
setSuperConcept(Concept c,
boolean isNEW)
Moves this concept in the inheritance hierarchy. |
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, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String UNDEFINED_SPECIAL_ATTRIBUTE
public static final java.lang.String UNKNOWN_SPECIAL_VALUE
public static final java.lang.String NO_SPECIAL_VALUE
public static final java.lang.String DEFAULT_FCT_NAME
public static final java.lang.String DEFAULT_FCT_NAME_TMP
public static final java.lang.String ID_DEFAULT
| Constructor Detail |
|---|
public Project()
throws java.lang.Exception
java.lang.Exception - never
public Project(java.lang.String path)
throws java.lang.Exception
path - the path to load the project from
java.lang.Exception - never| Method Detail |
|---|
public boolean isImporting()
public int getTotalNumberOfCases()
public int getCurrentNumberOfCases()
public void save()
public DefaultCaseBase createDefaultCB(java.lang.String name)
throws java.lang.Exception
name - the name of the new case base
java.lang.Exception - if there is a case base with that namepublic boolean hasCB(java.lang.String name)
name - the name of the case base
public ICaseBase getCB(java.lang.String name)
name - the name of the case base to be returned
public ICaseBase deleteCaseBase(java.lang.String name)
name - the unique name of the case base to be removed
public java.util.HashMap<java.lang.String,ICaseBase> getCaseBases()
public Concept createTopConcept(java.lang.String id)
throws java.lang.Exception
id - the name for the new c
java.lang.Exception - if there is another concept with name idpublic Concept getConceptByID(java.lang.String id)
id - the ID of the c description to be returned
public java.lang.Boolean hasConceptWithID(java.lang.String id)
id - the name to be checked
public java.util.LinkedList<AttributeDesc> getAttDescsByName(java.lang.String name)
name - the name of the attribute description's to be returned
public void setPath(java.lang.String path)
path - the project path to setpublic java.lang.String getPath()
public java.lang.String getExtension()
public void setAuthor(java.lang.String author)
author - the project author to setpublic java.lang.String getAuthor()
public SpecialDesc getSpecialValueDesc()
public boolean isSpecialAttribute(java.lang.String obj)
obj - the string which is checked
public ExplanationManager getExplanationManager()
public void addSpecialValue(java.lang.String value)
value - the special value to be addedpublic Instance getInstance(java.lang.String name)
Concept
getInstance in class Conceptname - the name of the instance to be returned
public TaxonomyFct getInhFct()
public void setInhFct(SpecialFct f)
SpecialDesc.addSpecialFct(String, boolean)
on getSpecialValueDesc()
f - the new special value functionpublic TaxonomyFct addInhFct(java.lang.String name)
name - the name of the new inheritance function
public SymbolFct getSpecialFct()
public void setSpecialValueFct(SpecialFct f)
SpecialDesc.addSpecialFct(String, boolean)
on getSpecialValueDesc()
f - the new special value function
public Similarity calculateSpecialSimilarity(Attribute att1,
Attribute att2)
att1 - the query's special valueatt2 - the case's special value
java.lang.Exception
public Similarity calculateMultipleAttributeSimilarity(java.lang.Object simFct,
MultipleAttribute<?> att1,
MultipleAttribute<?> att2)
MultipleAttribute objects
based on the given similarity function.
simFct - the similarity function to compare simple attributesatt1 - the query's multiple valueatt2 - the case's multiple value
public Attribute getSpecialAttribute(java.lang.String obj)
SpecialAttribute object corresponding to
the given string.
obj - the value for the special value attribute to be returned
SpecialDesc.getAttribute(String)
public void cleanInstances(Concept c,
AttributeDesc desc)
c - the concept whose instances should be cleaneddesc - the cases are cleaned wrt the attribute descriptionpublic Concept removeSubConcept(java.lang.String name)
Concept
removeSubConcept in class Conceptname - the name of the sub concept to be removed
public Concept getSuperConcept()
getSuperConcept in class Concept
public void setSuperConcept(Concept c,
boolean isNEW)
Concept
setSuperConcept in class Conceptc - the new super concept of thispublic java.util.HashMap<java.lang.String,AttributeDesc> getAttributeDescs()
ConceptConcept.getAllAttributeDescs()
getAttributeDescs in class Conceptpublic java.util.HashMap<java.lang.String,AttributeDesc> getAllAttributeDescs()
Concept
getAllAttributeDescs in class Concept
public void addAttributeDesc(AttributeDesc desc)
throws java.lang.Exception
Concept
addAttributeDesc in class Conceptdesc - the attribute description to be added to this description
java.lang.Exceptionpublic boolean removeAttributeDesc(java.lang.String name)
Concept
removeAttributeDesc in class Conceptpublic boolean canOverride(Concept c)
canOverride in class Conceptpublic Project getProject()
Concept
getProject in class Conceptpublic void addPartOfRelation(ConceptDesc desc)
Concept
addPartOfRelation in class Conceptdesc - the description which has a part-of relation to thispublic java.util.Vector<ConceptDesc> getPartOfRelations()
Concept
getPartOfRelations in class Conceptpublic void deletePartOfRelation(ConceptDesc desc)
Concept
deletePartOfRelation in class Conceptdesc - the part-of relation to be removedpublic void delete()
Concept
delete in class Concept
public Similarity getLocalSimilarity(Attribute a,
Attribute b,
AttributeDesc desc)
throws java.lang.Exception
a - the query attributeb - the case attributedesc - the attribute description underlying the given attributes
java.lang.Exception - if something goes wrong during similarity computations
public DefaultCaseBase createDefaultCB(java.lang.String cbName,
int currentCBCount)
throws java.lang.Exception
cbName - the name of the default case base to be createdcurrentCBCount - the number of expected cases
java.lang.Exception - if there is another case base with that name
public void update(java.util.Observable o,
java.lang.Object arg)
update in interface java.util.Observerupdate in class Conceptpublic void removeCase(java.lang.String name)
name - the cases' namepublic java.util.Collection<Instance> getAllInstances()
getAllInstances in class Concept
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||