jcreek.cke.importexport
Class KnowledgeModelExportUtilities

java.lang.Object
  extended byjcreek.cke.importexport.KnowledgeModelExportUtilities

public class KnowledgeModelExportUtilities
extends java.lang.Object

Some general methods used to ease the export process.

Author:
Stein L. Tomassen, NTNU 2002

Constructor Summary
KnowledgeModelExportUtilities(KnowledgeModel km)
          The constructor that only sets the JavaCreek Knowledge Model to use in the export process.
 
Method Summary
 java.lang.String getImportance(double importance, boolean includeDefault)
          Gets the discrete variable of the double value as a string of.
 java.lang.String getPredictiveStrength(double predictiveStrength, boolean includeDefault)
          Gets the discrete variable of the double value as a string of.
 java.lang.String getStrength(double strength, boolean includeDefault)
          Gets tyhe string representation of the strength value.
 boolean hasLength(java.lang.String text)
          Determines if a text is a text and not equal 'null' or of length 0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KnowledgeModelExportUtilities

public KnowledgeModelExportUtilities(KnowledgeModel km)
The constructor that only sets the JavaCreek Knowledge Model to use in the export process.

Parameters:
km - the JavaCreek Knowledge Model that the data should be exported from
Method Detail

hasLength

public boolean hasLength(java.lang.String text)
Determines if a text is a text and not equal 'null' or of length 0. This is e.g. important for 'description' fields in the knowledge model.

Parameters:
text - the text to check
Returns:
true if the text is of length more than 0 and not 'null', otherwise returns false.

getStrength

public java.lang.String getStrength(double strength,
                                    boolean includeDefault)
Gets tyhe string representation of the strength value. If the value is out of range, then the default value will be returned.

Parameters:
strength - the value to convert
includeDefault - if set to false, then if the value is the default value or out of range then 'null' will be returned, otherwise the real value will be returned.
Returns:
a string representation of the value. Does return the default value if out of range.

getImportance

public java.lang.String getImportance(double importance,
                                      boolean includeDefault)
Gets the discrete variable of the double value as a string of. The value will be maped againts the predefained values (see ActivationConstants below). If the value is not valid according to these values the default value will be returned.

Parameters:
importance - the value to convert
includeDefault - if set to false, then if the value is the default value or out of range then 'null' will be returned, otherwise the real value will be returned.
Returns:
returns a string representing the value. If the value isn't valid, then the default value will be returned.
See Also:
ActivationConstants

getPredictiveStrength

public java.lang.String getPredictiveStrength(double predictiveStrength,
                                              boolean includeDefault)
Gets the discrete variable of the double value as a string of. The value will be maped againts the predefained values (see ActivationConstants below). If the value is not valid according to these values the default value will be returned.

Parameters:
predictiveStrength - the value to convert
includeDefault - if set to false, then if the value is the default value or out of range then 'null' will be returned, otherwise the real value will be returned.
Returns:
returns a string representing the value. If the value isn't valid, then the default value will be returned.
See Also:
ActivationConstants


Created at IDI, NTNU by the Artificial Intelligence and Learning group