org.jsimpledb.parse.expr.ConstNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsimpledb-parse Show documentation
Show all versions of jsimpledb-parse Show documentation
JSimpleDB classes for parsing Java expressions.
The newest version!
/*
* Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
*/
package org.jsimpledb.parse.expr;
import com.google.common.base.Preconditions;
import org.jsimpledb.parse.ParseSession;
/**
* A {@link Node} that always evaluates to the same {@link Value}.
*/
public class ConstNode implements Node {
private final Value value;
public ConstNode(Value value) {
Preconditions.checkArgument(value != null, "null value");
this.value = value;
}
@Override
public Value evaluate(ParseSession session) {
return this.value;
}
@Override
public Class> getType(ParseSession session) {
return this.value.getType(session);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy