comparison src/main/gov/nasa/jpf/vm/choice/TypedObjectChoice.java @ 3:fdc263e5806b

added inverse matching in StringSetMatcher. Since this is not easy to do in regexes, it's at the next hight level in StringSetMatcher added a optional CG accessor interface (geChoice(i), getAllChoices(), getProcessedChoices() getUnprocessedChoices()) that can be used from listeners and peers to enumerate/analyse choice sets. Note that not all CGs have to support this as there is no requirement that CGs actually use pre-computed choice sets. The low level accessor is getChoice(i), ChoiceGeneratorBase provides generic (not very efficient) set accessor implementations. Note that ChoiceGeneratorBase.getChoice() has to be overridden in subclasses in order to support choice enumeration, the default impl is just there so that we don't break subclass compilation
author Peter Mehlitz <Peter.C.Mehlitz@nasa.gov>
date Tue, 03 Feb 2015 08:49:33 -0800
parents 61d41facf527
children cd7880ab73c7
comparison
equal deleted inserted replaced
2:b920e6b1be83 3:fdc263e5806b
71 71
72 count = -1; 72 count = -1;
73 } 73 }
74 74
75 @Override 75 @Override
76 public Integer getChoice (int idx){
77 if (idx >= 0 && idx < values.length){
78 return values[idx];
79 } else {
80 throw new IllegalArgumentException("choice index out of range: " + idx);
81 }
82 }
83
84
85 @Override
76 public void advance () { 86 public void advance () {
77 count++; 87 count++;
78 } 88 }
79 89
80 @Override 90 @Override