本文整理汇总了Java中net.opengis.fes.x20.ComparisonOpsType类的典型用法代码示例。如果您正苦于以下问题:Java ComparisonOpsType类的具体用法?Java ComparisonOpsType怎么用?Java ComparisonOpsType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ComparisonOpsType类属于net.opengis.fes.x20包,在下文中一共展示了ComparisonOpsType类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import net.opengis.fes.x20.ComparisonOpsType; //导入依赖的package包/类
/**
* Init method for this filter.
*
* @param binaryOp the operator type
* @param propertyNames set of used property names
*/
protected void initialize(BinaryLogicOpType binaryOp, HashSet<Object > propertyNames) {
if (binaryOp.getLogicOpsArray().length > 0) {
for (LogicOpsType lops : binaryOp.getLogicOpsArray()) {
this.elements.add(ALogicFilter.FACTORY.buildLogicFilter(lops, propertyNames));
}
}
if (binaryOp.getComparisonOpsArray().length > 0){
for (ComparisonOpsType cops : binaryOp.getComparisonOpsArray()) {
this.elements.add(AComparisonFilter.FACTORY.buildComparisonFilter(cops, propertyNames));
}
}
if (binaryOp.getSpatialOpsArray().length > 0) {
for (SpatialOpsType sops : binaryOp.getSpatialOpsArray()) {
this.elements.add(ASpatialFilter.FACTORY.buildSpatialFilter(sops));
}
}
if (binaryOp.getTemporalOpsArray().length > 0) {
for (TemporalOpsType tops : binaryOp.getTemporalOpsArray()) {
this.elements.add(ATemporalFilter.FACTORY.buildTemporalFilter(tops));
}
}
}
示例2: replaceForFilter
import net.opengis.fes.x20.ComparisonOpsType; //导入依赖的package包/类
/**
* helpermethod for replacePhenomenonStringsAndConvertUnits().
* @throws Exception
*/
public static void replaceForFilter(FilterType filter) throws Exception {
if (filter.isSetLogicOps()) {
replaceForLogicOp(filter.getLogicOps());
}
if (filter.isSetComparisonOps()) {
ComparisonOpsType cOps = filter.getComparisonOps();
replaceForComparisonOp(cOps);
}
}
示例3: replaceForLogicOp
import net.opengis.fes.x20.ComparisonOpsType; //导入依赖的package包/类
/**
* helpermethod for replacePhenomenonStringsAndConvertUnits().
* @throws Exception
*/
public static void replaceForLogicOp(LogicOpsType logicOps) throws Exception {
QName loQName = logicOps.newCursor().getName();
/*
* check Not
*/
if (NOT_QNAME.equals(loQName)) {
//create new NotFilter
UnaryLogicOpType unaryOp = (UnaryLogicOpType) logicOps;
if (unaryOp.isSetComparisonOps()) {
replaceForComparisonOp(unaryOp.getComparisonOps());
}
if (unaryOp.isSetLogicOps()) {
//rekursion
replaceForLogicOp(unaryOp.getLogicOps());
}
}
/*
* binary operators
*/
if (AND_QNAME.equals(loQName) || OR_QNAME.equals(loQName)) {
BinaryLogicOpType binaryOp = (BinaryLogicOpType) logicOps;
ComparisonOpsType[] array = binaryOp.getComparisonOpsArray();
for (ComparisonOpsType cOps : array) {
replaceForComparisonOp(cOps);
}
LogicOpsType[] array2 = binaryOp.getLogicOpsArray();
for (LogicOpsType logicOp : array2) {
replaceForLogicOp(logicOp);
}
}
}
示例4: createExpressionString
import net.opengis.fes.x20.ComparisonOpsType; //导入依赖的package包/类
@Override
public String createExpressionString(boolean complexPatternGuard) {
ComparisonOpsType ops = this.guard.getComparisonOps();
StringBuilder sb = new StringBuilder();
sb.append(" count(*) = ");
sb.append(findCount(convertToBinaryComparisonOp(ops).getExpressionArray()));
return sb.toString();
}
示例5: convertToBinaryComparisonOp
import net.opengis.fes.x20.ComparisonOpsType; //导入依赖的package包/类
protected static BinaryComparisonOpType convertToBinaryComparisonOp(ComparisonOpsType ops) {
QName coQName = ops.newCursor().getName();
if (EQUAL_QNAME.equals(coQName)) {
BinaryComparisonOpType bcop = (BinaryComparisonOpType) ops;
return bcop;
}
return null;
}
示例6: replaceForFilter
import net.opengis.fes.x20.ComparisonOpsType; //导入依赖的package包/类
/**
* helpermethod for replacePhenomenonStringsAndConvertUnits().
* @throws Exception
*/
public static void replaceForFilter(FilterType filter, IUnitConverter converter) throws Exception {
if (filter.isSetLogicOps()) {
replaceForLogicOp(filter.getLogicOps(), converter);
}
if (filter.isSetComparisonOps()) {
ComparisonOpsType cOps = filter.getComparisonOps();
replaceForComparisonOp(cOps, converter);
}
}
示例7: replaceForLogicOp
import net.opengis.fes.x20.ComparisonOpsType; //导入依赖的package包/类
/**
* helpermethod for replacePhenomenonStringsAndConvertUnits().
* @throws Exception
*/
public static void replaceForLogicOp(LogicOpsType logicOps, IUnitConverter converter) throws Exception {
QName loQName = logicOps.newCursor().getName();
/*
* check Not
*/
if (NOT_QNAME.equals(loQName)) {
//create new NotFilter
UnaryLogicOpType unaryOp = (UnaryLogicOpType) logicOps;
if (unaryOp.isSetComparisonOps()) {
replaceForComparisonOp(unaryOp.getComparisonOps(), converter);
}
if (unaryOp.isSetLogicOps()) {
//rekursion
replaceForLogicOp(unaryOp.getLogicOps(), converter);
}
}
/*
* binary operators
*/
if (AND_QNAME.equals(loQName) || OR_QNAME.equals(loQName)) {
BinaryLogicOpType binaryOp = (BinaryLogicOpType) logicOps;
ComparisonOpsType[] array = binaryOp.getComparisonOpsArray();
for (ComparisonOpsType cOps : array) {
replaceForComparisonOp(cOps, converter);
}
LogicOpsType[] array2 = binaryOp.getLogicOpsArray();
for (LogicOpsType logicOp : array2) {
replaceForLogicOp(logicOp, converter);
}
}
}
示例8: testAssociatedFeatureQueryCreation
import net.opengis.fes.x20.ComparisonOpsType; //导入依赖的package包/类
@Test
public void testAssociatedFeatureQueryCreation() {
GetAssociatedFeatureByGMLIdentifier request = new GetAssociatedFeatureByGMLIdentifier(OWS8Parser.AIXM_APRON_KEY, 10, "test");
ComparisonOpsType comparison = request.getFilter().getFilter().getComparisonOps();
if (comparison instanceof BinaryComparisonOpType) {
BinaryComparisonOpType bop = (BinaryComparisonOpType) comparison;
XmlObject exp = bop.getExpressionArray(0);
Assert.assertTrue("invalid filter expression", exp.xmlText().contains("wfs:valueOf(*/*/aixm:associatedApron)/*/gml:identifier"));
} else {
Assert.fail("no PropertyIsEqualTo found.");
}
}
示例9: setEntryConditions
import net.opengis.fes.x20.ComparisonOpsType; //导入依赖的package包/类
private void setEntryConditions(Rule rule, SimplePatternType entryCondition) {
ComparisonOpsType comparisonOps = getComparisonType(entryCondition);
String filterType = comparisonOps.getDomNode().getLocalName();
int binaryOperatorIndex = getSymbolIndexForFilter(filterType);
Quantity entryFilterValues = parseFilterQuantity(comparisonOps, binaryOperatorIndex);
rule.setEntryValue("" + entryFilterValues.getValue());
rule.setEntryUnit(entryFilterValues.getUom().getCode());
rule.setEntryOperatorIndex(binaryOperatorIndex);
}
示例10: setExitConditions
import net.opengis.fes.x20.ComparisonOpsType; //导入依赖的package包/类
private void setExitConditions(Rule rule, SimplePatternType exitCondition) {
ComparisonOpsType comparisonOps = getComparisonType(exitCondition);
String filterType = comparisonOps.getDomNode().getLocalName();
int binaryOperatorIndex = getSymbolIndexForFilter(filterType);
Quantity exitFilterValues = parseFilterQuantity(comparisonOps, binaryOperatorIndex);
rule.setExitValue("" + exitFilterValues.getValue());
rule.setExitUnit(exitFilterValues.getUom().getCode());
rule.setExitOperatorIndex(binaryOperatorIndex);
}
示例11: buildComparisonFilter
import net.opengis.fes.x20.ComparisonOpsType; //导入依赖的package包/类
/**
* Builds a new comparison filter
*
* @param comparisonOp definition of the filter
* @param propertyNames names of the properties used in this filter / pattern
*
* @return the new {@link ALogicFilter}
*/
public AComparisonFilter buildComparisonFilter(ComparisonOpsType comparisonOp, HashSet<Object > propertyNames) {
//TODO
QName coQName = comparisonOp.newCursor().getName();
/*
* non binary operators
*/
//check between
if (BETWEEN_QNAME.equals(coQName)) {
PropertyIsBetweenType betweenOp = (PropertyIsBetweenType) comparisonOp;
return new BetweenFilter(betweenOp, propertyNames);
}
/*
* binary operators
*/
BinaryComparisonOpType binaryOp = (BinaryComparisonOpType) comparisonOp;
//check equal
if (EQUAL_QNAME.equals(coQName)) {
return new EqualToFilter(binaryOp, propertyNames);
}
//check not equal
else if (NOT_EQUAL_QNAME.equals(coQName)) {
return new NotEqualToFilter(binaryOp, propertyNames);
}
//check greater
else if (GREATER_QNAME.equals(coQName)) {
return new GreaterThanFilter(binaryOp, propertyNames);
}
//check greater or equal
else if (GREATER_OR_EQUAL_QNAME.equals(coQName)) {
return new GreaterThanOrEqualToFilter(binaryOp, propertyNames);
}
//check less
else if (LESS_QNAME.equals(coQName)) {
return new LessThanFilter(binaryOp, propertyNames);
}
//check less or equal
else if (LESS_OR_EQUAL_QNAME.equals(coQName)) {
return new LessThanOrEqualToFilter(binaryOp, propertyNames);
}
logger.warn("unable to build comparison filter for '" + comparisonOp.newCursor().getName().toString() + "'");
return null;
}
示例12: getComparisonType
import net.opengis.fes.x20.ComparisonOpsType; //导入依赖的package包/类
private ComparisonOpsType getComparisonType(SimplePatternType entryCondition) {
FilterType entryFilter = entryCondition.getGuard().getFilter();
return entryFilter.getComparisonOps();
}