desc

Java code posted by me
created at 22 Oct 03:32, updated at 14 Nov 12:51

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

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() {

}
  
}
778 Bytes in 3 ms with coderay