1 20 21 package net.innig.macker.recording; 22 23 import net.innig.macker.event.*; 24 import net.innig.macker.rule.Rule; 25 import net.innig.macker.rule.RuleSet; 26 27 import java.io.PrintStream ; 28 import java.io.PrintWriter ; 29 import org.jdom.Element; 30 import net.innig.collect.CollectionDiff; 31 32 public abstract class EventRecording 33 { 34 public EventRecording(EventRecording parent) 35 { this.parent = parent; } 36 37 protected EventRecording getParent() 38 { return parent; } 39 40 public abstract EventRecording record(MackerEvent event); 41 42 public abstract void read(Element elem); 43 44 public boolean compare(EventRecording actual, PrintWriter out) 45 { 46 if(getClass() != actual.getClass()) 47 { 48 out.println("expected " + this + ", but got " + actual); 49 return false; 50 } 51 52 return true; 53 } 54 55 public void dump(PrintStream out, int indent) 56 { 57 PrintWriter outWriter = new PrintWriter (out); 58 dump(outWriter, indent); 59 outWriter.flush(); 60 } 61 62 public void dump(PrintWriter out, int indent) 63 { 64 for(int n = 0; n < indent; n++) 65 out.print(' '); 66 out.println(this); 67 } 68 69 private EventRecording parent; 70 } 71 | Popular Tags |