java.lang.Object
org.refcodes.criteria.AbstractCriteria
org.refcodes.criteria.AbstractSingleCriteriaNode
- All Implemented Interfaces:
Criteria
,CriteriaNode
,SingleCriteriaNode
,org.refcodes.mixin.NameAccessor
public abstract class AbstractSingleCriteriaNode extends AbstractCriteria implements SingleCriteriaNode
Base class with the base
SingleCriteriaNode
functionality provided for SingleCriteriaNode
implementations.- Version:
- $Id: $Id
- Author:
- steiner
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.NameAccessor
org.refcodes.mixin.NameAccessor.NameBuilder<B extends org.refcodes.mixin.NameAccessor.NameBuilder<B>>, org.refcodes.mixin.NameAccessor.NameMutator, org.refcodes.mixin.NameAccessor.NameProperty
-
Constructor Summary
Constructors Constructor Description AbstractSingleCriteriaNode(String aName)
Constructs aSingleCriteriaNode
with the given name.AbstractSingleCriteriaNode(String aName, Criteria aChild)
Constructs aSingleCriteriaNode
with the given name and the providedCriteria
child. -
Method Summary
Modifier and Type Method Description void
addChild(Criteria aCriteria)
Adds a childCriteria
to theCriteriaNode
.Criteria
getChild()
Returns the single childCriteria
being stored in thisCriteriaNode
.List<Criteria>
getChildren()
Returns the list of childCriteria
instances contained in theCriteriaNode
.void
setChild(Criteria aChild)
Sets the single childCriteria
to be stored in thisCriteriaNode
.Methods inherited from class org.refcodes.criteria.AbstractCriteria
getName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.mixin.NameAccessor
getName
-
Constructor Details
-
AbstractSingleCriteriaNode
Constructs aSingleCriteriaNode
with the given name.- Parameters:
aName
- The name of theSingleCriteriaNode
.
-
AbstractSingleCriteriaNode
Constructs aSingleCriteriaNode
with the given name and the providedCriteria
child.- Parameters:
aName
- The name of theSingleCriteriaNode
.aChild
- TheCriteria
child to be contained in theSingleCriteriaNode
.
-
-
Method Details
-
getChild
Returns the single childCriteria
being stored in thisCriteriaNode
.- Specified by:
getChild
in interfaceSingleCriteriaNode
- Returns:
- The according child
Criteria
.
-
setChild
Sets the single childCriteria
to be stored in thisCriteriaNode
.- Specified by:
setChild
in interfaceSingleCriteriaNode
- Parameters:
aChild
- The according childCriteria
.
-
addChild
Adds a childCriteria
to theCriteriaNode
. In case a specializedCriteriaNode
applies constraints on the number or type ofCriteria
which may be added, an according exception may be thrown. For example theSingleCriteriaNode
applies constraints on this method.- Specified by:
addChild
in interfaceCriteriaNode
- Parameters:
aCriteria
- The childCriteria
to be added.- Throws:
IllegalStateException
- In case constraints in terms of state are violated, implementation depended.IllegalArgumentException
- In case constraints in terms of argument are violated, implementation depended.
-
getChildren
Returns the list of childCriteria
instances contained in theCriteriaNode
.- Specified by:
getChildren
in interfaceCriteriaNode
- Returns:
- The
Criteria
instances contained in theCriteriaNode
.
-