@Override public String getValue(){ return super.getValue(); }
@Override public RichConstant setValue(String value){ return (RichConstant)super.setValue(value); }
/** * Create an instance of {@link Constant } * */ public Constant createConstant() { return new Constant(); }
static public DataType getConstantDataType(Constant constant){ DataType dataType = constant.getDataType(); if(dataType == null){ dataType = TypeUtil.getConstantDataType(constant.getValue()); } return dataType; }
throw new ParseException(); Constant constant = new Constant() .setValue(translateValue(value)) .setDataType(dataType);
@Override public DataType getDataType(){ DataType dataType = super.getDataType(); if(dataType == null){ dataType = TypeUtil.getConstantDataType(getValue()); setDataType(dataType); } return dataType; }
throw new ParseException(); Constant constant = new Constant() .setValue(translateValue(value)) .setDataType(dataType);
static private Map<String, String> parseRevalue(FunctionExpression.Argument replaceArgument){ Map<String, String> result = new LinkedHashMap<>(); FunctionExpression vectorExpression = toVectorExpression(replaceArgument); List<FunctionExpression.Argument> objectArguments = vectorExpression.getArguments(); for(FunctionExpression.Argument objectArgument : objectArguments){ String from = objectArgument.getTag(); if(from == null){ throw new IllegalArgumentException(); } Constant constant = (Constant)objectArgument.getExpression(); if(constant.getDataType() != null && (DataType.STRING).equals(constant.getDataType())){ throw new IllegalArgumentException(); } String to = constant.getValue(); result.put(from, to); } return result; }
@Override public DataType getDataType(){ DataType dataType = super.getDataType(); if(dataType == null){ dataType = TypeUtil.getConstantDataType(getValue()); setDataType(dataType); } return dataType; }
@Override public String getValue(){ return super.getValue(); }
@Override public RichConstant setValue(String value){ return (RichConstant)super.setValue(value); }
/** * Create an instance of {@link Constant } * */ public Constant createConstant() { return new Constant(); }
@Override public String getValue(){ return super.getValue(); }
@Override public RichConstant setValue(String value){ return (RichConstant)super.setValue(value); }
private LocalTransformations getLocalTranformations(NeuralNetwork model) { // delete target List<DerivedField> derivedFields = model.getLocalTransformations().getDerivedFields(); // add bias DerivedField field = new DerivedField(OpType.CONTINUOUS, DataType.DOUBLE).withName(new FieldName( PluginConstants.biasValue)); field.withExpression(new Constant(String.valueOf(PluginConstants.bias))); derivedFields.add(field); return new LocalTransformations().withDerivedFields(derivedFields); }
private Expression filterConstant(Constant constant){ if(("FMTWIDTH").equals(constant.getValue())){ FieldRef fieldRef = new FieldRef(FieldName.create("FMTWIDTH")); return fieldRef; } return constant; } }
static private List<String> parseVector(FunctionExpression.Argument argument){ List<String> result = new ArrayList<>(); FunctionExpression vectorExpression = toVectorExpression(argument); List<FunctionExpression.Argument> objectArguments = vectorExpression.getArguments(); for(FunctionExpression.Argument objectArgument : objectArguments){ Constant constant = (Constant)objectArgument.getExpression(); result.add(constant.getValue()); } return result; }