public abstract class ConstraintFactory extends Object
FSMatchConstraint
s for filtered iterators or other
use. A constraint is an object which represents a test or a series of tests joined with "and" or
"or". Each test consists of a test predicate plus an optional "path" which specifies how to walk
through a chain of references, starting from a feature structure being tested, to reach the value
to be tested.
Tests include
FSIntConstraint
, for
instance, the value would be an integer.Constructor and Description |
---|
ConstraintFactory() |
Modifier and Type | Method and Description |
---|---|
abstract FSMatchConstraint |
and(FSMatchConstraint c1,
FSMatchConstraint c2)
Conjoin two constraints.
|
abstract FSBooleanConstraint |
createBooleanConstraint()
Create a new boolean constraint.
|
abstract FSFloatConstraint |
createFloatConstraint()
Create a new float constraint.
|
abstract FSIntConstraint |
createIntConstraint()
Create a new int constraint.
|
abstract FSStringConstraint |
createStringConstraint()
Create a new String constraint.
|
abstract FSTypeConstraint |
createTypeConstraint()
Create a new type constraint.
|
abstract FSMatchConstraint |
embedConstraint(ArrayList<String> path,
FSConstraint constraint)
Embed a constraint under a path.
|
abstract FSMatchConstraint |
embedConstraint(FeaturePath path,
FSConstraint constraint)
Combine a constraint test with a path from a feature structure instance to the value to be
tested.
|
static ConstraintFactory |
instance()
Create a new constraint factory.
|
abstract FSMatchConstraint |
or(FSMatchConstraint c1,
FSMatchConstraint c2)
Disjoin two constraints.
|
public abstract FSTypeConstraint createTypeConstraint()
public abstract FSIntConstraint createIntConstraint()
public abstract FSFloatConstraint createFloatConstraint()
public abstract FSStringConstraint createStringConstraint()
public abstract FSBooleanConstraint createBooleanConstraint()
public abstract FSMatchConstraint embedConstraint(FeaturePath path, FSConstraint constraint)
path
- The path to embed the constraint under. Create a new path with
CAS.createFeaturePath()
.constraint
- The constraint to be embedded.public abstract FSMatchConstraint embedConstraint(ArrayList<String> path, FSConstraint constraint)
path
- The path to embed the constraint under. This is a list of Feature
names.constraint
- The constraint to be embedded.public abstract FSMatchConstraint and(FSMatchConstraint c1, FSMatchConstraint c2)
c1
- The first conjunct.c2
- The second conjunct.c1
and
c2
.public abstract FSMatchConstraint or(FSMatchConstraint c1, FSMatchConstraint c2)
c1
- The first disjunct.c2
- The second disjunct.c1
and
c2
.public static ConstraintFactory instance()
Copyright © 2006–2017 The Apache Software Foundation. All rights reserved.