Examples of DoubleAttribute


Examples of com.sun.xacml.attr.DoubleAttribute

        if (result != null)
            return result;

        GeometryAttribute geomAttr1 = (GeometryAttribute) (argValues[0]);
        GeometryAttribute geomAttr2 = (GeometryAttribute) (argValues[1]);
        DoubleAttribute withinDistance = (DoubleAttribute) (argValues[2]);

        boolean evalResult = false;

        try {
            evalResult = geomAttr1.getGeometry().isWithinDistance(geomAttr2.getGeometry(),
                    withinDistance.getValue());
        } catch (Throwable t) {
            return exceptionError(t);
        }
        return EvaluationResult.getInstance(evalResult);
    }
View Full Code Here

Examples of com.sun.xacml.attr.DoubleAttribute

        AttributeValue[] argValues = new AttributeValue[inputs.size()];
        EvaluationResult result = evalArgs(inputs, context, argValues);
        if (result != null)
            return result;

        DoubleAttribute value = (DoubleAttribute) (argValues[0]);
        StringAttribute unit = (StringAttribute) (argValues[1]);

        Double multiplyBy = UnitToMetre.get(unit.getValue());
        if (multiplyBy == null) {
            exceptionError(new Exception("Unit" + unit + " not supported"));
        }
        double resultValue = value.getValue() * multiplyBy;

        return new EvaluationResult(new DoubleAttribute(resultValue));
    }
View Full Code Here

Examples of com.sun.xacml.attr.DoubleAttribute

            length = geomAttr.getGeometry().getLength();
        } catch (Throwable t) {
            return exceptionError(t);
        }

        return new EvaluationResult(new DoubleAttribute(length));
    }
View Full Code Here

Examples of com.sun.xacml.attr.DoubleAttribute

        AttributeValue[] argValues = new AttributeValue[inputs.size()];
        EvaluationResult result = evalArgs(inputs, context, argValues);
        if (result != null)
            return result;

        DoubleAttribute value = (DoubleAttribute) (argValues[0]);
        StringAttribute unit = (StringAttribute) (argValues[1]);

        Double multiplyBy = UnitToSquareMetre.get(unit.getValue());
        if (multiplyBy == null) {
            exceptionError(new Exception("Unit" + unit + " not supported"));
        }
        double resultValue = value.getValue() * multiplyBy;

        return new EvaluationResult(new DoubleAttribute(resultValue));
    }
View Full Code Here

Examples of com.sun.xacml.attr.DoubleAttribute

        case ID_DOUBLE_SUBTRACT: {
            double arg0 = ((DoubleAttribute) argValues[0]).getValue();
            double arg1 = ((DoubleAttribute) argValues[1]).getValue();
            double difference = arg0 - arg1;

            result = new EvaluationResult(new DoubleAttribute(difference));
            break;
        }
        }

        return result;
View Full Code Here

Examples of com.sun.xacml.attr.DoubleAttribute

                break;
            }

            double quotient = dividend / divisor;

            result = new EvaluationResult(new DoubleAttribute(quotient));
            break;
        }
        }

        return result;
View Full Code Here

Examples of com.sun.xacml.attr.DoubleAttribute

            distance = geomAttr1.getGeometry().distance(geomAttr2.getGeometry());
        } catch (Throwable t) {
            return exceptionError(t);
        }

        return new EvaluationResult(new DoubleAttribute(distance));
    }
View Full Code Here

Examples of com.sun.xacml.attr.DoubleAttribute

            area = geomAttr.getGeometry().getArea();
        } catch (Throwable t) {
            return exceptionError(t);
        }

        return new EvaluationResult(new DoubleAttribute(area));
    }
View Full Code Here

Examples of com.sun.xacml.attr.DoubleAttribute

            retVal = new AnyURIAttribute((URI) object);
        if (object instanceof Boolean)
            retVal = ((Boolean) object) ? BooleanAttribute.getTrueInstance() : BooleanAttribute
                    .getFalseInstance();
        if (object instanceof Double)
            retVal = new DoubleAttribute((Double) object);
        if (object instanceof Float)
            retVal = new DoubleAttribute((Float) object);
        if (object instanceof Integer)
            retVal = new IntegerAttribute((Integer) object);
        if (object instanceof Date)
            retVal = new DateTimeAttribute((Date) object);
        if (object instanceof Geometry) {
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.DoubleAttribute

  @SuppressWarnings("unchecked")
  @Test
  public void setAttributes() throws Exception {
    Map<String, Attribute> map = new HashMap<String, Attribute>();
    map.put(ATTRIBUTE_NAME, new StringAttribute("Heikant"));
    map.put(ATTRIBUTE_POPULATION, new DoubleAttribute(100.0));
    featureModel.setAttributes(feature, map);
    Assert.assertEquals("Heikant", featureModel.getAttribute(feature, ATTRIBUTE_NAME).getValue());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.