gzz-commits
[Top][All Lists]
Advanced

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

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


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz/gzz/vob DefaultVobMatcher.java
Date: Sat, 19 Oct 2002 10:28:33 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/10/19 10:28:32

Modified files:
        gzz/vob        : DefaultVobMatcher.java 

Log message:
        A key mapper, for use with buoys

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

Patches:
Index: gzz/gzz/vob/DefaultVobMatcher.java
diff -c gzz/gzz/vob/DefaultVobMatcher.java:1.8 
gzz/gzz/vob/DefaultVobMatcher.java:1.9
*** gzz/gzz/vob/DefaultVobMatcher.java:1.8      Mon Sep 30 18:20:28 2002
--- gzz/gzz/vob/DefaultVobMatcher.java  Sat Oct 19 10:28:32 2002
***************
*** 36,41 ****
--- 36,43 ----
      Key[] keyByCs = new Key[INITIAL_SIZE];
      Map csByKey = new HashMap();
  
+     Map keymap;
+ 
      int maxcs = 0;
  
      class Key {
***************
*** 104,109 ****
--- 106,129 ----
        }
      }
  
+     /** Set a map from keys of this vobcoorder to keys of the
+      * one being interpolated to this.
+      * Useful for specifying e.g. buoy interpolation.
+      */
+     public void setKeyMap(Map m) {
+       keymap = m;
+     }
+ 
+     /** Map a key to a key of the other interpolating
+      * vobmatcher.
+      */
+     private Object mapkey(Object o) {
+       if(keymap == null) return o;
+       Object n = keymap.get(o);
+       if(n != null) return n;
+       return o;
+     }
+ 
      public int[] interpList(VobMatcher other0) {
          DefaultVobMatcher other = (DefaultVobMatcher)other0;
        int[] interpList = new int[maxcs+1];
***************
*** 120,126 ****
                // XXX assumes that parent is set already
                int other_parent = interpList[k.parent];
  
!               Key other_key = new Key(k.key, other_parent);
                interpList[i] = other.getCSByKeyObject(other_key);
  
                if(dbg) pa(i+" "+k.parent+" "+other_parent+" "+
--- 140,146 ----
                // XXX assumes that parent is set already
                int other_parent = interpList[k.parent];
  
!               Key other_key = new Key(mapkey(k.key), other_parent);
                interpList[i] = other.getCSByKeyObject(other_key);
  
                if(dbg) pa(i+" "+k.parent+" "+other_parent+" "+




reply via email to

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