m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu/mimuw/cloudatlas/model
diff options
context:
space:
mode:
authorMagdalena Grodzińska <mag.grodzinska@gmail.com>2020-01-14 21:54:11 +0100
committerMagdalena Grodzińska <mag.grodzinska@gmail.com>2020-01-14 21:54:11 +0100
commitc4513b4817ec623d026fa35682b4934a211e1b8a (patch)
tree155ebe27406631c264b32eb7ba403e8a0b84ba71 /src/main/java/pl/edu/mimuw/cloudatlas/model
parentb3dd7a505549662d558eec550f210f0d6f0ec547 (diff)
Some small fixes
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/model')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/model/ValueQuery.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/model/ValueQuery.java b/src/main/java/pl/edu/mimuw/cloudatlas/model/ValueQuery.java
index 3edda69..f049603 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/model/ValueQuery.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/model/ValueQuery.java
@@ -56,6 +56,16 @@ public class ValueQuery extends Value {
this.timestamp = System.currentTimeMillis();
}
+ public ValueQuery(String query, long timestamp) throws Exception {
+ this.code = query;
+ if (!query.isEmpty()) {
+ Yylex lex = new Yylex(new ByteArrayInputStream(query.getBytes()));
+ this.query = (new parser(lex)).pProgram();
+ }
+ this.signature = null;
+ this.timestamp = timestamp;
+ }
+
private ValueQuery() {
this.code = null;
this.query = null;