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

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

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

revision 1.7 by tjl, Sun Jan 5 16:32:51 2003 UTC revision 1.8 by tjl, Mon Jan 6 11:51:59 2003 UTC
# Line 43  public class DefaultVobMatcher implement Line 43  public class DefaultVobMatcher implement
43    
44      class Key {      class Key {
45          Object key; int parent;          Object key; int parent;
46            int interpolateTo;
47          Key(Object k, int p) { key=k; parent=p; }          Key(Object k, int p) { key=k; parent=p; }
48          public int hashCode() { return key.hashCode() ^ parent; }          public int hashCode() { return key.hashCode() ^ parent; }
49          public boolean equals(Object o) {          public boolean equals(Object o) {
# Line 138  public class DefaultVobMatcher implement Line 139  public class DefaultVobMatcher implement
139          return o;          return o;
140      }      }
141    
142        public void keymapSingleCoordsys(int mine, int other) {
143            keyByCs[mine].interpolateTo = other;
144        }
145    
146      public int[] interpList(VobMatcher other0, boolean towardsOther) {      public int[] interpList(VobMatcher other0, boolean towardsOther) {
147          DefaultVobMatcher other = (DefaultVobMatcher)other0;          DefaultVobMatcher other = (DefaultVobMatcher)other0;
148          int[] interpList = new int[maxcs+1];          int[] interpList = new int[maxcs+1];
# Line 147  public class DefaultVobMatcher implement Line 152  public class DefaultVobMatcher implement
152                  interpList[i] = -1;                  interpList[i] = -1;
153              else {              else {
154                  Key k = keyByCs[i];                  Key k = keyByCs[i];
155                    if(!towardsOther && k.interpolateTo > 0) {
156                        int csTo = k.interpolateTo;
157                        Key kOther = other.keyByCs[csTo];
158                        // Need to check; otherwise can get core dumps
159                        if(kOther == null) {
160                            pa("??!!! interp wrong");
161                        } else {
162                            if(dbg) pa(i+" overridden into "+csTo);
163                            interpList[i] = csTo;
164                        }
165                        continue;
166                    }
167    
168                  if(k.parent < 0 || k.parent >= i)                  if(k.parent < 0 || k.parent >= i)
169                      throw new Error("argh "+k.parent);                      throw new Error("argh "+k.parent);

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

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