Interface AtomicClass
-
- All Superinterfaces:
DataClass,PropertyHandler
- All Known Subinterfaces:
BooleanClass,ByteArrayClass,ChronologicClass,DateClass,DoubleClass,IntegerClass,NumericClass,StringClass,TimeClass,TimestampClass,URIClass
- All Known Implementing Classes:
AtomicClassImpl,BooleanClassImpl,ByteArrayClassImpl,ChronologicClassImpl,DateClassImpl,DoubleClassImpl,IntegerClassImpl,NumericClassImpl,StringClassImpl,TimeClassImpl,TimeStampClassImpl,URIClassImpl
public interface AtomicClass extends DataClass
The group of Atomic Classes is used to store exact one value. The counterpart in programming languages are data types like integer, double, or Boolean in Java. A specialisation can restrict the value ranges with intervals or enumerations. Intervals can only be used for Atomic classes that have totally ordered instances like instances of sub-classes from theNumericClassor theChronologicClass. E.g., a class "Age" would be a sub-class ofIntegerClass, restricted to values between zero and 150. These intervals are just restrictions of the possible values of an attribute with an Atomic Class as type and not the definition of intervals in instances of a class. Of course, this is also possible by using the data classIntervalClass. Enumerations define fix values for a class, e.g., a class "Colour" would be realised as sub-class ofStringClasswith the fixed values "red", "green", and "blue". Such enumeration values can be ordered totally or arranged in taxonomies. An exceptional role plays the Atomic ClassByteArrayClassthat can be used to store more complex data objects like images or documents. Internally, it is of course an array of bytes, but conceptually it is used as one value, e.g., one image.Atomic classes can have only one InstancePredicate that is automatically assigned if it is created by one of the factory methods
createNewInstanceEnumerationPredicate()orcreateNewInstanceIntervalPredicate().All AtomicClasses provide methods to convert the content objects to a
Stringand from aString. See the methodsnativeFromString(String)andnativeToString(Object). For example, the XML parser using this method to convert the value of anAtomicObjectinto a String and back.Atomic classes can have only one InstancePredicate that is automatically assigned if it is created by one of the factory methods
createNewInstanceEnumerationPredicate()orcreateNewInstanceIntervalPredicate().All AtomicClasses provide methods to convert the content objects to a
Stringand from aString. See the methodsnativeFromString(String)andnativeToString(Object). For example, the XML parser using this method to convert the value of anAtomicObjectinto a String and back.AtomicObject object = ...; xmlWriter.append("value", object.getAtomicClass().nativeToString( object.getNativeObject()));Never use the
Object.toString()method because this method is for debugging purposes and results additional informations.- Author:
- Rainer Maximini
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLASS_NAMEConstantCLASS_NAME="Atomic"static StringCOMPONENTComponent: "cake.data.model" (LogComponentIdentifier.COMPONENT)static StringCOMPONENT_KEYComponent-Key: "04" (LogComponentIdentifier.COMPONENT_KEY_ATOMICCLASS)static StringLOG_CANNOT_HANDLE_NATIVE_VALUESThis class can not handle native values.static StringLOG_INTERVAL_BORDERS_INCOMPATIBLEThe interval-borders in this class are incompatible.static StringLOG_PARSING_NATIVE_VALUEThe native value could not be converted to match this class.static StringLOG_UNKNOWN_NATIVE_VALUEThe native-value class is unknown.static StringLOG_UNKNOWN_VALUE_IN_ORDERThe value in anInstanceValueOrderPredicateis not defined in theInstanceEnumerationPredicate.static StringLOG_VALUE_RANGE_INCOMPATIBLEValue is not compatible with the class' value range.-
Fields inherited from interface de.uni_trier.wi2.procake.data.model.DataClass
LOG_ABSTRACT_CLASS_NOT_INSTANTIABLE, LOG_ABSTRACT_SYSTEM_SUBCLASS_CREATION_FAILED, LOG_CLASS_NOT_EDITABLE, LOG_CLASS_NOT_INSTANTIABLE, LOG_EDITABLE_CLASS_NOT_INSTANTIABLE, LOG_FINISH_EDIT_FAILED, LOG_GET_SUPERCLASSES_FAILED, LOG_SUBCLASS_CREATION_FAILED
-
-
Method Summary
-
Methods inherited from interface de.uni_trier.wi2.procake.data.model.DataClass
addSubclass, checkInstantiability, createSubclass, finishEditing, getModel, getName, getObjectClass, getSubClasses, getSuperClass, getSuperClasses, getSystemClassName, getSystemSuperClass, includeClass, isAbstract, isAggregate, isAtomic, isBoolean, isByteArray, isCake2DataReference, isChronologic, isCollection, isControlflowItem, isDataflowWrapper, isDate, isDouble, isEditable, isInstantiable, isInteger, isInterval, isList, isNESTConstraintEdge, isNESTControlflowEdge, isNESTControlflowNode, isNESTDataflowEdge, isNESTDataNode, isNESTEdge, isNESTGraph, isNESTGraphItem, isNESTNode, isNESTPartOfEdge, isNESTSequenceNode, isNESTSequentialWorkflow, isNESTSubWorkflowNode, isNESTTaskNode, isNESTWorkflow, isNESTWorkflowNode, isNode, isNumeric, isParentItem, isSequence, isSet, isString, isSubclassOf, isSubWorkflow, isSystemClass, isTask, isTime, isTimestamp, isUnion, isURI, isVoid, isWorkflow, isWorkflowItem, newObject, removeSubclass, setAbstract, setName
-
Methods inherited from interface de.uni_trier.wi2.procake.data.PropertyHandler
addProperty, addProperty, getAllProperties, getAllPropertyNodes, getProperty, getPropertyNames, getPropertyNode, getPropertyRootNode, hasProperties, removeProperty
-
-
-
-
Field Detail
-
CLASS_NAME
static final String CLASS_NAME
ConstantCLASS_NAME="Atomic"- See Also:
- Constant Field Values
-
COMPONENT
static final String COMPONENT
Component: "cake.data.model" (LogComponentIdentifier.COMPONENT)- See Also:
- Constant Field Values
-
COMPONENT_KEY
static final String COMPONENT_KEY
Component-Key: "04" (LogComponentIdentifier.COMPONENT_KEY_ATOMICCLASS)- See Also:
- Constant Field Values
-
LOG_CANNOT_HANDLE_NATIVE_VALUES
static final String LOG_CANNOT_HANDLE_NATIVE_VALUES
This class can not handle native values.- Component:
COMPONENT - Key: "0404"
- this
- See Also:
- Constant Field Values
- Component:
-
LOG_INTERVAL_BORDERS_INCOMPATIBLE
static final String LOG_INTERVAL_BORDERS_INCOMPATIBLE
The interval-borders in this class are incompatible.- Component:
COMPONENT - Key: "0401"
- this
- Lower border
- Upper border
- See Also:
- Constant Field Values
- Component:
-
LOG_PARSING_NATIVE_VALUE
static final String LOG_PARSING_NATIVE_VALUE
The native value could not be converted to match this class.- Component:
COMPONENT - Key: "0403"
- this
- Native value
- See Also:
- Constant Field Values
- Component:
-
LOG_UNKNOWN_NATIVE_VALUE
static final String LOG_UNKNOWN_NATIVE_VALUE
The native-value class is unknown.- Component:
COMPONENT - Key: "0402"
- this
- Native-value class
- See Also:
- Constant Field Values
- Component:
-
LOG_UNKNOWN_VALUE_IN_ORDER
static final String LOG_UNKNOWN_VALUE_IN_ORDER
The value in anInstanceValueOrderPredicateis not defined in theInstanceEnumerationPredicate.- Component:
COMPONENT - Key: "0405"
- this
InstanceValueOrderPredicate- the value:
AtomicObject
- See Also:
- Constant Field Values
- Component:
-
LOG_VALUE_RANGE_INCOMPATIBLE
static final String LOG_VALUE_RANGE_INCOMPATIBLE
Value is not compatible with the class' value range.- Component:
COMPONENT - Key: "0400"
- this
- Value
- See Also:
- Constant Field Values
- Component:
-
-
Method Detail
-
createNewInstanceEnumerationPredicate
InstanceEnumerationPredicate createNewInstanceEnumerationPredicate() throws IllegalEditException
Creates a new
InstanceEnumerationPredicatefor this class. The predicate is automitcally assigned. If a predicate is already defined, it will be removed and replaced with the new one.After creation the old instance predicate is no longer available. If it is needed call the
getInstancePredicate()method first. *- Returns:
- The new instance of InstanceEnumerationPredicate.
- Throws:
IllegalEditException
-
createNewInstanceIntervalPredicate
InstanceIntervalPredicate createNewInstanceIntervalPredicate() throws IllegalEditException
Creates a newInstanceIntervalPredicatefor this class. The predicate is automatically assigned. If a predicate is already defined, it will be removed and replaced with the new one.After creation the old instance predicate is no longer available. If it is needed call the
getInstancePredicate()method first.- Returns:
- The new instance of InstanceIntervalPredicate.
- Throws:
IllegalEditException
-
createNewInstanceTaxonomyOrderPredicate
InstanceTaxonomyOrderPredicate createNewInstanceTaxonomyOrderPredicate() throws IllegalEditException
createNewInstanceTaxonomyOrderPredicate.
- Returns:
- a
InstanceTaxonomyOrderPredicateobject - Throws:
IllegalEditException- if any.
-
createNewInstanceTotalOrderPredicate
InstanceTotalOrderPredicate createNewInstanceTotalOrderPredicate() throws IllegalEditException
createNewInstanceTotalOrderPredicate.
- Returns:
- a
InstanceTotalOrderPredicateobject - Throws:
IllegalEditException- if any.
-
createNewInstanceOntologyOrderPredicate
InstanceOntologyOrderPredicate createNewInstanceOntologyOrderPredicate() throws IllegalEditException
createNewInstanceOntologyOrderPredicate.
- Returns:
- a
InstanceOntologyOrderPredicateobject - Throws:
IllegalEditException- if any.
-
getDefaultValue
Object getDefaultValue()
The default value is either a defined value withsetDefaultValue(Object)or an arbitrary but valid one.If the class is not finished, null will return if no default one defined manually. After finishing the class an arbitrary valid value is returned.
- Returns:
- A valid native object of the class.
-
setDefaultValue
void setDefaultValue(Object defaultValue) throws IllegalEditException
Each AtomicClass contains a default value that is used to initialize anAtomicObject. This method is optional and must not be specified.- Parameters:
defaultValue- The initiale value of a newAtomicObject- Throws:
IllegalEditException
-
getInstancePredicate
InstancePredicate getInstancePredicate()
Returns the instance predicate that is defined in the atomic class- Returns:
- InstancePredicate the defined predicate or
nullif no one is defined. - See Also:
InstanceEnumerationPredicate,InstanceIntervalPredicate
-
getInstanceEnumerationPredicate
InstanceEnumerationPredicate getInstanceEnumerationPredicate()
getInstanceEnumerationPredicate.
- Returns:
- a
InstanceEnumerationPredicateobject
-
getInstanceIntervalPredicate
InstanceIntervalPredicate getInstanceIntervalPredicate()
getInstanceIntervalPredicate.
- Returns:
- a
InstanceIntervalPredicateobject
-
getInstanceTaxonomyOrderPredicate
InstanceTaxonomyOrderPredicate getInstanceTaxonomyOrderPredicate()
getInstanceTaxonomyOrderPredicate.
- Returns:
- a
InstanceTaxonomyOrderPredicateobject
-
getInstanceTotalOrderPredicate
InstanceTotalOrderPredicate getInstanceTotalOrderPredicate()
getInstanceTotalOrderPredicate.
- Returns:
- a
InstanceTotalOrderPredicateobject
-
hasEnumerationRange
boolean hasEnumerationRange()
Checks if anInstancePredicateis defined and if the predicate is anInstanceEnumerationPredicate.- Returns:
trueifgetInstancePredicate()is notnulland an instance ofInstanceEnumerationPredicate.
-
hasIntervalRange
boolean hasIntervalRange()
Checks if anInstancePredicateis defined and if the predicate is anInstanceIntervalPredicate.- Returns:
trueifgetInstancePredicate()is notnulland an instance ofInstanceIntervalPredicate.
-
hasTaxonomyRange
boolean hasTaxonomyRange()
hasTaxonomyRange.
- Returns:
- a boolean
-
hasTotalOrderRange
boolean hasTotalOrderRange()
hasTotalOrderRange.
- Returns:
- a boolean
-
nativeFromString
Object nativeFromString(String value) throws InvalidNativeValueException
Converts a String to the native object of the correspondingAtomicObject- Parameters:
value- The String representation of the value- Returns:
- a new Object representing the
value - Throws:
InvalidNativeValueException
-
nativeToString
String nativeToString(Object value) throws InvalidNativeValueException
Converts a native object of the correspondingAtomicObjectto a String.- Parameters:
value- The native object that should be converted.- Returns:
- a String representation of the
value - Throws:
InvalidNativeValueException
-
removeInstancePredicate
InstancePredicate removeInstancePredicate() throws IllegalEditException
Removes a definedInstancePredicatefrom the atomic class.- Returns:
- Returns the removed instance predicate or
nullif none was defined. - Throws:
IllegalEditException
-
addAtomicObject
void addAtomicObject(AtomicObject atomicObject)
addAtomicObject.
- Parameters:
atomicObject- aAtomicObjectobject
-
getAtomicObjects
LinkedList<AtomicObject> getAtomicObjects()
getAtomicObjects.
- Returns:
- a
LinkedListobject
-
-