Title / Description
Code import java.util.Random; import java.lang.Math; import java.awt.*; import java.applet.*; import java.util.*; import java.io.*; import java.awt.event.*; class SemanticRecord { private int _kind; private int _value; private SpreadsheetCell _which; private static final int num = 0; private static final int cell = 1; private static final int empty = 2; SemanticRecord(int kind, SpreadsheetCell which, int value) { _kind = kind; _which = which; _value = value; } SpreadsheetCell which() { return _which; } int evaluate() { if(_kind == num ) return _value; else if (_kind == cell) return _which.evaluate(); else return 0; // should never be executed actually. } public static void main() { } }
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code