# HG changeset patch # User Peter Mehlitz # Date 1423887615 28800 # Node ID 8de43b2b023fb827f1b6843f84aa6fbfcb49c939 # Parent 54b7125309a9453ce82e67f0752919f613610f23 added choice getters for EventChoiceGenerator added some minor Event functions diff -r 54b7125309a9 -r 8de43b2b023f src/main/gov/nasa/jpf/util/event/Event.java --- a/src/main/gov/nasa/jpf/util/event/Event.java Wed Feb 11 19:16:10 2015 -0800 +++ b/src/main/gov/nasa/jpf/util/event/Event.java Fri Feb 13 20:20:15 2015 -0800 @@ -182,6 +182,20 @@ return n; } + public boolean hasAlternatives(){ + return (alt != null); + } + + public List getAlternatives(){ + List list = new ArrayList(); + list.add(this); + for (Event e = alt; e != null; e = e.alt) { + list.add(e); + } + return list; + } + + public Event unlinkedClone(){ try { Event e = (Event)super.clone(); diff -r 54b7125309a9 -r 8de43b2b023f src/main/gov/nasa/jpf/util/event/EventChoiceGenerator.java --- a/src/main/gov/nasa/jpf/util/event/EventChoiceGenerator.java Wed Feb 11 19:16:10 2015 -0800 +++ b/src/main/gov/nasa/jpf/util/event/EventChoiceGenerator.java Fri Feb 13 20:20:15 2015 -0800 @@ -207,4 +207,44 @@ public Class getChoiceType() { return Event.class; } + + protected Event[] getFirstNChoices(int n){ + Event[] a = new Event[n]; + + Event e = base; + for (int i=0; i