Class InstanceIntervalPredicateImpl
- java.lang.Object
-
- de.uni_trier.wi2.procake.data.model.base.impl.InstancePredicateImpl
-
- de.uni_trier.wi2.procake.data.model.base.impl.InstanceIntervalPredicateImpl
-
- All Implemented Interfaces:
InstanceIntervalPredicate,InstancePredicate
public class InstanceIntervalPredicateImpl extends InstancePredicateImpl implements InstanceIntervalPredicate
Description is missing- Author:
- Rainer Maximini
-
-
Field Summary
-
Fields inherited from class de.uni_trier.wi2.procake.data.model.base.impl.InstancePredicateImpl
atomicClass
-
-
Constructor Summary
Constructors Constructor Description InstanceIntervalPredicateImpl(AtomicClassImpl parentClass)Constructor for InstanceIntervalPredicateImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanafter(AtomicObject intervalObject, AtomicObject otherIntervalObject)Checks, if an object ofNumericClassorChronologicClassis after another object of the same class.booleanbefore(AtomicObject intervalObject, AtomicObject otherIntervalObject)Checks, if an object ofNumericClassorChronologicClassis before another object of the same class.protected voidcheckFinishEditing()checkFinishEditing.protected voidfinishEditing()finishEditing.AtomicObjectgetMaximum()getMaximum.AtomicObjectgetMinimum()getMinimum.booleanholdsFor(AtomicObject value)Checks if the given totally ordered value is an element of the interval.booleanholdsFor(Object value)EachInstancePredicatemust implement this method to check if the givenvalueis an element of theInstancePredicate.booleanisIntervalPredicate()isIntervalPredicate.voidsetMaximum(AtomicObject maxValue)Defines the maximum value of the interval.voidsetMinimum(AtomicObject minValue)Defines the minimum value of the interval.-
Methods inherited from class de.uni_trier.wi2.procake.data.model.base.impl.InstancePredicateImpl
getAtomicClass, isEnumerationPredicate, isTaxonomyOrderPredicate, isTotalOrderPredicate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.uni_trier.wi2.procake.data.model.base.InstancePredicate
getAtomicClass, isEnumerationPredicate, isTaxonomyOrderPredicate, isTotalOrderPredicate
-
-
-
-
Constructor Detail
-
InstanceIntervalPredicateImpl
public InstanceIntervalPredicateImpl(AtomicClassImpl parentClass)
Constructor for InstanceIntervalPredicateImpl.
- Parameters:
parentClass- aAtomicClassImplobject
-
-
Method Detail
-
checkFinishEditing
protected void checkFinishEditing() throws ClassHierarchyConsistencyExceptioncheckFinishEditing.
- Overrides:
checkFinishEditingin classInstancePredicateImpl- Throws:
ClassHierarchyConsistencyException- if any.
-
finishEditing
protected void finishEditing() throws ClassHierarchyConsistencyExceptionfinishEditing.
- Overrides:
finishEditingin classInstancePredicateImpl- Throws:
ClassHierarchyConsistencyException- if any.
-
getMaximum
public AtomicObject getMaximum()
getMaximum.
- Specified by:
getMaximumin interfaceInstanceIntervalPredicate- Returns:
- the upper bound of the interval
-
setMaximum
public void setMaximum(AtomicObject maxValue)
Defines the maximum value of the interval.- Specified by:
setMaximumin interfaceInstanceIntervalPredicate- Parameters:
maxValue- the upper bound of the interval
-
getMinimum
public AtomicObject getMinimum()
getMinimum.
- Specified by:
getMinimumin interfaceInstanceIntervalPredicate- Returns:
- the lower bound of the interval
-
setMinimum
public void setMinimum(AtomicObject minValue)
Defines the minimum value of the interval.- Specified by:
setMinimumin interfaceInstanceIntervalPredicate- Parameters:
minValue- the lower bound of the interval
-
holdsFor
public boolean holdsFor(Object value)
EachInstancePredicatemust implement this method to check if the givenvalueis an element of theInstancePredicate.- Specified by:
holdsForin interfaceInstancePredicate- Parameters:
value- The value to check- Returns:
trueif the value is an element of theInstancePredicate
-
holdsFor
public boolean holdsFor(AtomicObject value) throws UncomparableObjectsException
Checks if the given totally ordered value is an element of the interval. The method returnstrueif one of the following relations are true-
value == getMinimum() -
value == getMaximum() -
value.before(getMaximum()) && value.after(getMinimum())
During editing the relations between maximum and minimum can be wrong. The relation is only be fixed during finishing the predicate. Consequently, this method can be return a wrong value if the predicate is not finished.
- Specified by:
holdsForin interfaceInstanceIntervalPredicate- Parameters:
value- A totally ordered object.- Returns:
- true if
valuein included in the interval - Throws:
UncomparableObjectsException- is thrown if value does not match to the bounds of the predicate
-
-
isIntervalPredicate
public boolean isIntervalPredicate()
isIntervalPredicate.
- Specified by:
isIntervalPredicatein interfaceInstancePredicate- Overrides:
isIntervalPredicatein classInstancePredicateImpl- Returns:
trueif the predicate is anInstanceIntervalPredicate
-
after
public boolean after(AtomicObject intervalObject, AtomicObject otherIntervalObject) throws UncomparableObjectsException
Checks, if an object ofNumericClassorChronologicClassis after another object of the same class.- Specified by:
afterin interfaceInstanceIntervalPredicate- Parameters:
intervalObject- The object from which the order comparison starts.otherIntervalObject- The object that is checked if it is after the other object.- Returns:
trueifotheris after this.- Throws:
UncomparableObjectsException- is thrown if the object are not comparable
-
before
public boolean before(AtomicObject intervalObject, AtomicObject otherIntervalObject) throws UncomparableObjectsException
Checks, if an object ofNumericClassorChronologicClassis before another object of the same class.- Specified by:
beforein interfaceInstanceIntervalPredicate- Parameters:
intervalObject- The object from which the order comparison starts.otherIntervalObject- The object that is checked if it is before the other object.- Returns:
trueifotheris before this.- Throws:
UncomparableObjectsException- is thrown if the object are not comparable
-
-