Created
December 5, 2014 19:09
-
-
Save timtadh/7e26958faeaf863b82ea to your computer and use it in GitHub Desktop.
GSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cwru.kxh337.arrowc.il; | |
import java.util.Map; | |
import java.util.LinkedHashMap; | |
import com.google.gson.Gson; | |
public class IntValue extends Value { | |
int value = 0; | |
public IntValue(int value) { | |
this.value = value; | |
} | |
public Map<String,Object> toJson() { | |
Map<String,Object> M = new LinkedHashMap<String,Object>(); | |
M.put("type", "int-constant"); | |
M.put("value", value); | |
return M; | |
} | |
} | |
(new Gson()).toJson(value.toJson()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment