gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gzz/vob/impl DefaultVobMatcher.java


From: Matti Katila
Subject: [Gzz-commits] gzz/gzz/vob/impl DefaultVobMatcher.java
Date: Thu, 12 Dec 2002 10:39:31 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Matti Katila <address@hidden>   02/12/12 10:39:31

Modified files:
        gzz/vob/impl   : DefaultVobMatcher.java 

Log message:
        dumbs ;)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/impl/DefaultVobMatcher.java.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: gzz/gzz/vob/impl/DefaultVobMatcher.java
diff -u gzz/gzz/vob/impl/DefaultVobMatcher.java:1.5 
gzz/gzz/vob/impl/DefaultVobMatcher.java:1.6
--- gzz/gzz/vob/impl/DefaultVobMatcher.java:1.5 Tue Dec 10 15:24:00 2002
+++ gzz/gzz/vob/impl/DefaultVobMatcher.java     Thu Dec 12 10:39:31 2002
@@ -76,6 +76,9 @@
     public int add(int into, int cs, Object key) {
         ensure(cs);
         if(key == null) key = NULL;
+
+       if (dbg) checkIfKeyAlreadyExist(new Key(key, into));
+
         keyByCs[cs] = new Key(key, into);
        csByKey.put(keyByCs[cs], new Integer(cs));
        return cs;
@@ -176,9 +179,17 @@
        return interpList;
     }
 
-    public void dumbByEquals() {
-       pa("size keyByCs: " + keyByCs.length);
+    private void checkIfKeyAlreadyExist(Key key) {
+       for (int i=0; i<keyByCs.length; i++) {
+           if (keyByCs[i] == null) continue;
+           if (key.equals((Key)keyByCs[i])) {
+               pa("KEY ALREADY EXIST!!! : " + key.key);
+           }
+       }
+    }
+
 
+    public void dumpByEquals() {
        Vector keys = new Vector();
 
        for (int i=0; i<keyByCs.length; i++) {
@@ -216,7 +227,7 @@
        }
     }  
 
-    private void dumbParentRecursive(int cs, Vector shown) {
+    private void dumpParentRecursive(int cs, Vector shown) {
        shown.add(new Integer(cs));
 
        if (cs < 0) return;
@@ -226,17 +237,29 @@
            return;
        }
 
-       if(keyByCs[cs] == null)
+       if(keyByCs[cs] == null || keyByCs[cs] == NULL)
            pa(cs + " :   NULL  ");
 
        pa(cs + " : " +((Key)keyByCs[cs]).toString() + " --->");
        //pa("       \\|/    ");
-       dumbParentRecursive(((Key)keyByCs[cs]).parent, shown);
+       dumpParentRecursive(((Key)keyByCs[cs]).parent, shown);
        return;
     }
 
 
-    public void dumbByParent() {
+    public void dumpByParent(int cs) {
+       if (keyByCs[cs] == null) {
+           pa(cs + " : is null");
+           return;
+       }
+
+       Vector shown = new Vector();
+
+       pa("");
+       dumpParentRecursive(cs, shown);
+    }
+
+    public void dumpByParent() {
 
        Vector shown = new Vector();
 
@@ -253,7 +276,7 @@
 
            if (!already) {
                pa("");
-               dumbParentRecursive(i, shown);
+               dumpParentRecursive(i, shown);
            }
        }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]