gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
Uklonjeni primeri za OHashSet
[spa2-materijali.git] / Hash / OHashSet / XO.java
diff --git a/Hash/OHashSet/XO.java b/Hash/OHashSet/XO.java
deleted file mode 100644 (file)
index 8645f09..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-import org.svetovid.io.SvetovidReader;
-
-/**
- * Igra XO
- * 
- * Prosiruje InfoTip samo zbog jednostavnosti u TestHash, nema razloga inace.
- */
-public class XO extends InfoTip {
-       public static final int DIM = 3;
-       private int[][] tabla = new int[DIM][DIM];
-
-       public XO() {
-       }
-
-       @Override
-       public InfoTip ucitaj(SvetovidReader r) {
-               XO rez = new XO();
-               for (int i = 0; i < DIM; i++) {
-                       for (int j = 0; j < DIM; j++) {
-                               rez.tabla[i][j] = r.readInt();
-                       }
-               }
-               return rez;
-       }
-
-       public boolean equals(Object o) {
-               // Objekat je identican
-               if (this == o) {
-                       return true;
-               }
-               // Null je uvek razlicit
-               if (o == null) {
-                       return false;
-               }
-               // Ako su klase razlicite, objekti ne mogu bili jednaki
-               if (getClass() != o.getClass()) {
-                       return false;
-               }
-
-               // menjamo tip da mozemo da poredimo
-               XO o2 = (XO) o;
-               // posto je u ovoj klasi uvek inicijalizovano polje table
-               // i uvek je DIM x DIM ne moramo proveravati null
-               for (int i = 0; i < DIM; i++) {
-                       for (int j = 0; j < DIM; j++) {
-                               if (o2.tabla[i][j] != tabla[i][j]) {
-                                       return false;
-                               }
-                       }
-               }
-               return true;
-       }
-
-       @Override
-       public int hashCode() {
-               int rez = 0;
-               for (int i = 0; i < DIM; i++) {
-                       for (int j = 0; j < DIM; j++) {
-                               rez += tabla[i][j];
-                       }
-               }
-               return rez;
-       }
-
-       // pomocni metod za lakse testiranje
-       public static void main(String[] args) {
-               new TestHash(new XO(), "xo").run();
-       }
-}
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner