package narzedzia.op1;
import narzedzia.Expression;
import narzedzia.Pair;
import narzedzia.Collection;
import java.io.*;
public class Variable extends Expression{
private static Collection c=new Collection();
public static void add(String s, int n) throws Exception {
try {
c.insert(new Pair(s,n));
}
catch (Exception e) {
c.update(s,n);
}
}
private String s;
public Variable(String s) {
this.s=s;
}
public int Compute() {
try {
return c.find(s);
}
catch (Exception e) {
return 0;
}
}
public String toString() {
return s;
}
}