~ubuntu-branches/ubuntu/vivid/mkgmap/vivid

« back to all changes in this revision

Viewing changes to src/uk/me/parabola/mkgmap/osmstyle/eval/OrOp.java

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2014-08-13 22:13:41 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20140813221341-i9dzzjuto2o7hfh6
Tags: 0.0.0+svn3333-1
* New upstream version
  Closes: #745097
* add debian/classpath (thanks for the patch to Manfred Stock
  <manfred.stock+debian@gmail.com>)
  Closes: #741596
* d/copyright: DEP5

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 */
17
17
package uk.me.parabola.mkgmap.osmstyle.eval;
18
18
 
 
19
import uk.me.parabola.imgfmt.ExitException;
19
20
import uk.me.parabola.mkgmap.reader.osm.Element;
20
21
 
21
22
/**
33
34
                return getFirst().eval(el) || getSecond().eval(el);
34
35
        }
35
36
 
 
37
        public boolean eval(int cacheId, Element el){
 
38
                if (lastCachedId != cacheId){
 
39
                        if (lastCachedId > cacheId){
 
40
                                throw new ExitException("fatal error: cache id invalid");
 
41
                        }
 
42
                        lastRes = getFirst().eval(cacheId, el);
 
43
                        if (lastRes == false)
 
44
                                lastRes = getSecond().eval(cacheId, el);
 
45
                        lastCachedId = cacheId;
 
46
                }
 
47
                //else System.out.println("cached: " + cacheId + " " + toString());
 
48
                return lastRes;
 
49
        }
 
50
 
36
51
        public int priority() {
37
52
                return 3;
38
53
        }