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
NumericClass
or the
ChronologicClass
. E.g., a class "Age" would be a
sub-class of IntegerClass
, 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 class
IntervalClass
. Enumerations define fix values
for a class, e.g., a class "Colour" would be realised as sub-class of
StringClass
with the fixed values "red",
"green", and "blue". Such enumeration values can be ordered totally or arranged in taxonomies. An
exceptional role plays the Atomic Class
ByteArrayClass
that 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()
or
createNewInstanceIntervalPredicate()
.
All AtomicClasses provide methods to convert the content objects to a String
and from a String
. See the methods nativeFromString(String)
and
nativeToString(Object)
. For example, the XML parser using this method to convert the
value of an AtomicObject
into 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()
or
createNewInstanceIntervalPredicate()
.
All AtomicClasses provide methods to convert the content objects to a
String
and from a String
. See the methods
nativeFromString(String)
and nativeToString(Object)
. For example, the XML
parser using this method to convert the value of an
AtomicObject
into 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
Modifier and TypeFieldDescriptionstatic final String
ConstantCLASS_NAME="Atomic"
static final String
static final String
static final String
static final String
static final String
static final String
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
Modifier and TypeMethodDescriptionvoid
addAtomicObject
(AtomicObject atomicObject) addAtomicObject.Creates a newInstanceEnumerationPredicate
for this class.Creates a newInstanceIntervalPredicate
for this class.createNewInstanceOntologyOrderPredicate.createNewInstanceTaxonomyOrderPredicate.createNewInstanceTotalOrderPredicate.getAtomicObjects.The default value is either a defined value withsetDefaultValue(Object)
or an arbitrary but valid one.getInstanceEnumerationPredicate.getInstanceIntervalPredicate.getInstanceOntologyOrderPredicate.Returns the instance predicate that is defined in the atomic classgetInstanceTaxonomyOrderPredicate.getInstanceTotalOrderPredicate.boolean
Checks if anInstancePredicate
is defined and if the predicate is anInstanceEnumerationPredicate
.boolean
Checks if anInstancePredicate
is defined and if the predicate is anInstanceIntervalPredicate
.boolean
hasTaxonomyRange.boolean
hasTotalOrderRange.nativeFromString
(String value) Converts a String to the native object of the correspondingAtomicObject
nativeToString
(Object value) Converts a native object of the correspondingAtomicObject
to a String.Removes a definedInstancePredicate
from the atomic class.void
setDefaultValue
(Object defaultValue) Each AtomicClass contains a default value that is used to initialize anAtomicObject
.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, setPropertyRootNode
-
Field Details
-
CLASS_NAME
ConstantCLASS_NAME="Atomic"
- See Also:
-
LOG_CANNOT_HANDLE_NATIVE_VALUES
- See Also:
-
LOG_INTERVAL_BORDERS_INCOMPATIBLE
- See Also:
-
LOG_PARSING_NATIVE_VALUE
- See Also:
-
LOG_UNKNOWN_NATIVE_VALUE
- See Also:
-
LOG_UNKNOWN_VALUE_IN_ORDER
- See Also:
-
LOG_VALUE_RANGE_INCOMPATIBLE
- See Also:
-
-
Method Details
-
createNewInstanceEnumerationPredicate
Creates a new
InstanceEnumerationPredicate
for 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
Creates a newInstanceIntervalPredicate
for 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 IllegalEditExceptioncreateNewInstanceTaxonomyOrderPredicate.
- Returns:
- a
InstanceTaxonomyOrderPredicate
object - Throws:
IllegalEditException
- if any.
-
createNewInstanceTotalOrderPredicate
createNewInstanceTotalOrderPredicate.
- Returns:
- a
InstanceTotalOrderPredicate
object - Throws:
IllegalEditException
- if any.
-
createNewInstanceOntologyOrderPredicate
InstanceOntologyOrderPredicate createNewInstanceOntologyOrderPredicate() throws IllegalEditExceptioncreateNewInstanceOntologyOrderPredicate.
- Returns:
- a
InstanceOntologyOrderPredicate
object - 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
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
null
if no one is defined. - See Also:
-
getInstanceEnumerationPredicate
InstanceEnumerationPredicate getInstanceEnumerationPredicate()getInstanceEnumerationPredicate.
- Returns:
- a
InstanceEnumerationPredicate
object
-
getInstanceIntervalPredicate
InstanceIntervalPredicate getInstanceIntervalPredicate()getInstanceIntervalPredicate.
- Returns:
- a
InstanceIntervalPredicate
object
-
getInstanceTaxonomyOrderPredicate
InstanceTaxonomyOrderPredicate getInstanceTaxonomyOrderPredicate()getInstanceTaxonomyOrderPredicate.
- Returns:
- a
InstanceTaxonomyOrderPredicate
object
-
getInstanceTotalOrderPredicate
InstanceTotalOrderPredicate getInstanceTotalOrderPredicate()getInstanceTotalOrderPredicate.
- Returns:
- a
InstanceTotalOrderPredicate
object
-
getInstanceOntologyOrderPredicate
InstanceOntologyOrderPredicate getInstanceOntologyOrderPredicate()getInstanceOntologyOrderPredicate.
- Returns:
- a
InstanceOntologyOrderPredicate
object
-
hasEnumerationRange
boolean hasEnumerationRange()Checks if anInstancePredicate
is defined and if the predicate is anInstanceEnumerationPredicate
.- Returns:
true
ifgetInstancePredicate()
is notnull
and an instance ofInstanceEnumerationPredicate
.
-
hasIntervalRange
boolean hasIntervalRange()Checks if anInstancePredicate
is defined and if the predicate is anInstanceIntervalPredicate
.- Returns:
true
ifgetInstancePredicate()
is notnull
and an instance ofInstanceIntervalPredicate
.
-
hasTaxonomyRange
boolean hasTaxonomyRange()hasTaxonomyRange.
- Returns:
- a boolean
-
hasTotalOrderRange
boolean hasTotalOrderRange()hasTotalOrderRange.
- Returns:
- a boolean
-
nativeFromString
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
Converts a native object of the correspondingAtomicObject
to a String.- Parameters:
value
- The native object that should be converted.- Returns:
- a String representation of the
value
- Throws:
InvalidNativeValueException
-
removeInstancePredicate
Removes a definedInstancePredicate
from the atomic class.- Returns:
- Returns the removed instance predicate or
null
if none was defined. - Throws:
IllegalEditException
-
addAtomicObject
addAtomicObject.
- Parameters:
atomicObject
- aAtomicObject
object
-
getAtomicObjects
LinkedList<AtomicObject> getAtomicObjects()getAtomicObjects.
- Returns:
- a
LinkedList
object
-