public ReferenceValue referenceArrayLoad(IntegerValue indexValue, ValueFactory valueFactory) {
   return type == null
       ? ValueFactory.REFERENCE_VALUE_NULL
       : !ClassUtil.isInternalArrayType(type)
           ? ValueFactory.REFERENCE_VALUE_JAVA_LANG_OBJECT_MAYBE_NULL
           : valueFactory.createValue(type.substring(1), referencedClass, true).referenceValue();
 }
示例#2
0
 public Value eval(RCvalue args) throws EvalException {
   if (args.size() != 2) throw new EvalException("usage: reduce(polygon, errtol])");
   PolygonValue pv1 = (PolygonValue) args.value(0);
   PolygonValue pv2 = (PolygonValue) args.value(1);
   boolean isContain = pv1.polygon().contains(pv2.polygon());
   double contain = 0;
   if (isContain) {
     contain = 1; // we don't have a boolean factory now.
   }
   return ValueFactory.create(contain);
 }
 /** Returns the length of the array, assuming this type is an array. */
 public IntegerValue arrayLength(ValueFactory valueFactory) {
   return valueFactory.createIntegerValue();
 }