/[gzz]/gzz/gzz/vob/DefaultVobMatcher.java
ViewVC logotype

Diff of /gzz/gzz/vob/DefaultVobMatcher.java

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

revision 1.8 by tjl, Mon Sep 30 22:20:28 2002 UTC revision 1.9 by tjl, Sat Oct 19 14:28:32 2002 UTC
# Line 36  public class DefaultVobMatcher implement Line 36  public class DefaultVobMatcher implement
36      Key[] keyByCs = new Key[INITIAL_SIZE];      Key[] keyByCs = new Key[INITIAL_SIZE];
37      Map csByKey = new HashMap();      Map csByKey = new HashMap();
38    
39        Map keymap;
40    
41      int maxcs = 0;      int maxcs = 0;
42    
43      class Key {      class Key {
# Line 104  public class DefaultVobMatcher implement Line 106  public class DefaultVobMatcher implement
106          }          }
107      }      }
108    
109        /** Set a map from keys of this vobcoorder to keys of the
110         * one being interpolated to this.
111         * Useful for specifying e.g. buoy interpolation.
112         */
113        public void setKeyMap(Map m) {
114            keymap = m;
115        }
116    
117        /** Map a key to a key of the other interpolating
118         * vobmatcher.
119         */
120        private Object mapkey(Object o) {
121            if(keymap == null) return o;
122            Object n = keymap.get(o);
123            if(n != null) return n;
124            return o;
125        }
126    
127      public int[] interpList(VobMatcher other0) {      public int[] interpList(VobMatcher other0) {
128          DefaultVobMatcher other = (DefaultVobMatcher)other0;          DefaultVobMatcher other = (DefaultVobMatcher)other0;
129          int[] interpList = new int[maxcs+1];          int[] interpList = new int[maxcs+1];
# Line 120  public class DefaultVobMatcher implement Line 140  public class DefaultVobMatcher implement
140                  // XXX assumes that parent is set already                  // XXX assumes that parent is set already
141                  int other_parent = interpList[k.parent];                  int other_parent = interpList[k.parent];
142    
143                  Key other_key = new Key(k.key, other_parent);                  Key other_key = new Key(mapkey(k.key), other_parent);
144                  interpList[i] = other.getCSByKeyObject(other_key);                  interpList[i] = other.getCSByKeyObject(other_key);
145    
146                  if(dbg) pa(i+" "+k.parent+" "+other_parent+" "+                  if(dbg) pa(i+" "+k.parent+" "+other_parent+" "+

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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