/[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.9 by tjl, Wed Feb 12 17:22:51 2003 UTC revision 1.10 by tjl, Wed Feb 12 17:42:19 2003 UTC
# Line 28  import java.util.*; Line 28  import java.util.*;
28  /** A simple hierarchical implementation of VobMatcher.  /** A simple hierarchical implementation of VobMatcher.
29   */   */
30  public class DefaultVobMatcher implements VobMatcher {  public class DefaultVobMatcher implements VobMatcher {
31    private static final String rcsid = "$Id$";  
32      public static boolean dbg = false;      public static boolean dbg = false;
33      private static void pa(String s) { System.err.println(s); }      private static void pa(String s) { System.err.println(s); }
34    
# Line 135  public class DefaultVobMatcher implement Line 136  public class DefaultVobMatcher implement
136          DefaultVobMatcher other = (DefaultVobMatcher)other0;          DefaultVobMatcher other = (DefaultVobMatcher)other0;
137          int[] interpList = new int[maxcs+1];          int[] interpList = new int[maxcs+1];
138          if(dbg) pa("interplist: "+interpList[0]);          if(dbg) pa("interplist: "+interpList[0]);
139            int[] toOther = null;
140            if(towardsOther) { // Construct inverse forced matches
141                toOther = new int[maxcs+1];
142                for(int i=0; i<other.maxcs+1; i++) {
143                    if(other.keyByCs[i] != null &&
144                       other.keyByCs[i].interpolateTo > 0) {
145                        toOther[other.keyByCs[i].interpolateTo] = i;
146                    }
147                }
148            }
149          for(int i=1; i<maxcs+1; i++) {          for(int i=1; i<maxcs+1; i++) {
150              if(keyByCs[i] == null)              if(keyByCs[i] == null)
151                  interpList[i] = -1;                  interpList[i] = -1;
152              else {              else {
153                  Key k = keyByCs[i];                  Key k = keyByCs[i];
154                  if(!towardsOther && k.interpolateTo > 0) {                  if(towardsOther) {
155                      int csTo = k.interpolateTo;                      if(toOther[i] > 0)  {
156                      Key kOther = other.keyByCs[csTo];                          if(dbg) pa("Inverse overridden: "+i+" "+
157                      // Need to check; otherwise can get core dumps                                      toOther[i]);
158                      if(kOther == null) {                          interpList[i] = toOther[i];
159                          pa("??!!! interp wrong");                          continue;
160                      } else {                      }
161                          if(dbg) pa(i+" overridden into "+csTo);                  } else {
162                          interpList[i] = csTo;                      if(k.interpolateTo > 0) {
163                            int csTo = k.interpolateTo;
164                            Key kOther = other.keyByCs[csTo];
165                            // Need to check; otherwise can get core dumps
166                            if(kOther == null) {
167                                pa("??!!! interp wrong");
168                            } else {
169                                if(dbg) pa(i+" overridden into "+csTo);
170                                interpList[i] = csTo;
171                            }
172                            continue;
173                      }                      }
                     continue;  
174                  }                  }
175    
176                  if(k.parent < 0 || k.parent >= i)                  if(k.parent < 0 || k.parent >= i)

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

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