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 { |
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]; |
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+" "+ |