/[libvob]/libvob/org/nongnu/libvob/impl/DefaultVobMatcher.java
ViewVC logotype

Diff of /libvob/org/nongnu/libvob/impl/DefaultVobMatcher.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by benja, Fri Apr 25 13:41:58 2003 UTC revision 1.5 by tjl, Wed Aug 13 06:42:01 2003 UTC
# Line 56  private static final String rcsid = "$Id Line 56  private static final String rcsid = "$Id
56              return parent == k.parent && key.equals(k.key);              return parent == k.parent && key.equals(k.key);
57          }          }
58          public String toString() {          public String toString() {
59              return "DefaultVobMatcher key: "+key+" parent: "+parent;              return "[DefaultVobMatcher key: "+key+" parent: "+parent+"]";
60          }          }
61      }      }
62      void ensure(int n) {      void ensure(int n) {
# Line 90  private static final String rcsid = "$Id Line 90  private static final String rcsid = "$Id
90      }      }
91      public int add(int into, int cs, Object key) {      public int add(int into, int cs, Object key) {
92          ensure(cs);          ensure(cs);
93            if(cs < 0)
94                throw new Error("Trying to add negative parent!");
95          if(key == null) key = NULL;          if(key == null) key = NULL;
96    
97          if (dbg) checkIfKeyAlreadyExist(new Key(key, into));          if (dbg) checkIfKeyAlreadyExist(new Key(key, into));
# Line 190  private static final String rcsid = "$Id Line 192  private static final String rcsid = "$Id
192                      }                      }
193                  }                  }
194    
195                  if(k.parent < 0 || k.parent >= i)                  if(k.parent < 0 || k.parent >= i) {
196                      throw new Error("argh "+k.parent);                      dumpSimply();
197                        throw new Error("Got an invalid parent for "+i+" "+k.parent);
198                    }
199    
200                  // XXX assumes that parent is set already                  // XXX assumes that parent is set already
201                  int other_parent = interpList[k.parent];                  int other_parent = interpList[k.parent];
# Line 314  private static final String rcsid = "$Id Line 318  private static final String rcsid = "$Id
318                  pa(i + " : Real NULL");                      pa(i + " : Real NULL");    
319          }          }
320      }      }
321    
322        public void dumpSimply() {
323            for(int i=1; i<maxcs+1; i++) {
324                if(keyByCs[i] != null)
325                    pa(i+" "+keyByCs[i]);
326            }
327        }
328  }  }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26