@Override public AstLiteralIntegerValue visitLiteralInteger(LiteralIntegerContext ctx) { String literal = ctx.literal.getText().replaceAll("_", ""); AstLiteralIntegerValue value = new AstLiteralIntegerValue(Integer.decode(literal)); value.setRegionInfo(asSequentialRegion(childInfos, ctx)); return value; }
@Override protected boolean equalTo(AstRegion that) { return (that instanceof AstLiteralIntegerValue) && equalTo((AstLiteralIntegerValue) that); }
@Override public Masker visit(AstLiteralIntegerValue literal, State state) { int value = literal.getValue(); if (value != 0) { byte[] array = ByteBuffer.allocate(Integer.BYTES) .putInt(value) .array(); return Maskers.newMasker(array); } // no need to unmask for all-zeros masking key return Masker.IDENTITY_MASKER; }
public AstWriteOptionNodeBuilder setOptionValue(int optionValue) { node.setOptionValue(new AstLiteralIntegerValue(optionValue)); return this; }
@Override public MessageEncoder visit(AstLiteralIntegerValue value, Void parameter) { return new WriteIntegerEncoder(value.getValue()); }
public AstWriteNodeBuilder addInteger(Integer value) { node.addValue(new AstLiteralIntegerValue(value)); return this; }
@Override public AstValue<T> visitLiteralInteger(LiteralIntegerContext ctx) { AstLiteralIntegerValueVisitor visitor = new AstLiteralIntegerValueVisitor(factory, environment); AstLiteralIntegerValue literal = visitor.visit(ctx); AstValue<?> value = literal; if (expectedType == long.class || expectedType == Long.class) { value = new AstLiteralLongValue(literal.getValue().longValue()); } if (value != null) { childInfos().add(value.getRegionInfo()); } return (AstValue<T>) value; }
public StreamNested<R> addInteger(Integer value) { node.addValue(new AstLiteralIntegerValue(value)); return this; }
public AstPropertyNodeBuilder setPropertyValue(int propertyValue) { node.setPropertyValue(new AstLiteralIntegerValue(propertyValue)); return this; }
public AstReadOptionNodeBuilder setOptionValue(int optionValue) { node.setOptionValue(new AstLiteralIntegerValue(optionValue)); return this; }
public StreamNested<R> setOptionValue(int optionValue) { node.setOptionValue(new AstLiteralIntegerValue(optionValue)); return this; }
public StreamNested<R> setOptionValue(int optionValue) { node.setOptionValue(new AstLiteralIntegerValue(optionValue)); return this; }
public ScriptNested<R> setPropertyValue(int propertyValue) { node.setPropertyValue(new AstLiteralIntegerValue(propertyValue)); return this; }