/** * This applies the KeywordSpecification validation and additionally checks * whether the given value has the correct length. * * {@inheritDoc } */ @Override public boolean validate(Value value) { return value == null || (super.validate(value) && ((VectorialValue) value).getVector().length == length); }
public V extractValue(@NonNull Node node) { final Value val = node.getValue(keyword); if (val == null) { return null; } switch (type) { case STRING: return (V) ((StringValue) val).getString(); case SYMBOLIC: return (V) ((SymbolicValue) val).getSymbol(); case VECTOR: return (V) ((VectorialValue) val).getVector(); default: throw new IllegalArgumentException("Unsupported ValueType: " + type); } }
final VectorialValue leftVal = (VectorialValue) op.getLeft(). getValue(spec.getOriginalIndex(k)); local_d = leftVal.getVector().length; System.arraycopy(leftVal.getVector(), 0, out[0][i], d, local_d); break; final VectorialValue rightVal = (VectorialValue) op.getRight(). getValue(spec.getOriginalIndex(k)); local_d = rightVal.getVector().length; System.arraycopy(rightVal.getVector(), 0, out[1][i], d, local_d); break;