public class PositionedIncidentCondition extends Object implements HGQueryCondition, HGAtomPredicate
A PositionedLinkCondition
constraints the query result set to
links pointing to a target atom positioned within a predetermined range in
the link tuple. The range is specified with a lower and an upper bound where
negative values mean that position are evaluated from the last target in the link.
For example a value of -1 means the last target in the link tuple, -2 means the
one before the last etc. In addition, the condition allows you to specify that
the target should be position anywhere else except in the specified range. You can
do this by passing true
as the complement
parameter
in the condition's constructor.
Note that the lower and upper bound in the range specification are inclusive. A range of [1, 5] means all positions 1 to 5, included, are examined. Position counting starts at 0 and, as mentioned above, position -1 means the last element.
Constructor and Description |
---|
PositionedIncidentCondition() |
PositionedIncidentCondition(HGHandle target,
Integer position) |
PositionedIncidentCondition(HGHandle target,
Integer lowerBound,
Integer upperBound) |
PositionedIncidentCondition(HGHandle target,
Integer lowerBound,
Integer upperBound,
boolean complement) |
PositionedIncidentCondition(Ref<HGHandle> target,
Ref<Integer> position) |
PositionedIncidentCondition(Ref<HGHandle> target,
Ref<Integer> position,
Ref<Boolean> complement) |
PositionedIncidentCondition(Ref<HGHandle> target,
Ref<Integer> lowerBound,
Ref<Integer> upperBound,
Ref<Boolean> complement) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Ref<Boolean> |
getComplementRef() |
Ref<Integer> |
getLowerBoundRef() |
Ref<HGHandle> |
getTargetRef() |
Ref<Integer> |
getUpperBoundRef() |
int |
hashCode() |
boolean |
satisfies(HyperGraph hg,
HGHandle handle)
Check whether a given
Object satisfies this
query condition. |
void |
setComplementRef(Ref<Boolean> complementRef) |
void |
setLowerBoundRef(Ref<Integer> lowerBoundRef) |
void |
setTargetRef(Ref<HGHandle> targetRef) |
void |
setUpperBoundRef(Ref<Integer> upperBoundRef) |
String |
toString() |
public PositionedIncidentCondition()
public PositionedIncidentCondition(HGHandle target, Integer lowerBound, Integer upperBound)
public PositionedIncidentCondition(HGHandle target, Integer lowerBound, Integer upperBound, boolean complement)
public PositionedIncidentCondition(Ref<HGHandle> target, Ref<Integer> position)
public PositionedIncidentCondition(Ref<HGHandle> target, Ref<Integer> position, Ref<Boolean> complement)
public boolean satisfies(HyperGraph hg, HGHandle handle)
HGAtomPredicate
Check whether a given Object
satisfies this
query condition.
satisfies
in interface HGAtomPredicate
hg
- The HyperGraph
instance.handle
- The atom on which to test the query condition.true
if the passed in parameter satisfies
the condition and false
otherwise.Copyright © 2015. All rights reserved.