Package org.refcodes.criteria
Class AbstractSingleCriteriaNode
- 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 baseSingleCriteriaNode
functionality provided forSingleCriteriaNode
implementations.- Version:
- $Id: $Id
- Author:
- steiner
-
-
Constructor Summary
Constructors Constructor Description AbstractSingleCriteriaNode(java.lang.String aName)
Constructs aSingleCriteriaNode
with the given name.AbstractSingleCriteriaNode(java.lang.String aName, Criteria aChild)
Constructs aSingleCriteriaNode
with the given name and the providedCriteria
child.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(Criteria aCriteria)
Adds a childCriteria
to theCriteriaNode
.Criteria
getChild()
Returns the single childCriteria
being stored in thisCriteriaNode
.java.util.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
-
-
-
-
Constructor Detail
-
AbstractSingleCriteriaNode
public AbstractSingleCriteriaNode(java.lang.String aName)
Constructs aSingleCriteriaNode
with the given name.- Parameters:
aName
- The name of theSingleCriteriaNode
.
-
AbstractSingleCriteriaNode
public AbstractSingleCriteriaNode(java.lang.String aName, Criteria aChild)
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 Detail
-
getChild
public Criteria getChild()
Returns the single childCriteria
being stored in thisCriteriaNode
.- Specified by:
getChild
in interfaceSingleCriteriaNode
- Returns:
- The according child
Criteria
.
-
setChild
public void setChild(Criteria aChild)
Sets the single childCriteria
to be stored in thisCriteriaNode
.- Specified by:
setChild
in interfaceSingleCriteriaNode
- Parameters:
aChild
- The according childCriteria
.
-
addChild
public void addChild(Criteria aCriteria) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
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:
java.lang.IllegalStateException
- In case constraints in terms of state are violated, implementation depended.java.lang.IllegalArgumentException
- In case constraints in terms of argument are violated, implementation depended.
-
getChildren
public java.util.List<Criteria> getChildren()
Returns the list of childCriteria
instances contained in theCriteriaNode
.- Specified by:
getChildren
in interfaceCriteriaNode
- Returns:
- The
Criteria
instances contained in theCriteriaNode
.
-
-