@Test public void testWriteTrigger() throws Exception{ writer.write(TRIGGER_T1); replay(writer); eventTriggerWriter.writeTrigger(triggerT1); verify(writer); }
public void writeTrigger(EventTrigger trigger) throws IOException { String id = trigger.getId(); if( !writtenIds.contains(id) ) writtenIds.add(id); String line = trigger.getId() + "\t" + trigger.getSpecificType() + " " + trigger.getBegin() + " " + trigger.getEnd() + "\t" + documentText.substring(trigger.getBegin(), trigger.getEnd()) + "\n"; writer.write(line); }
EventTriggerWriter { public void writeTrigger(EventTrigger trigger) throws IOException { String id = trigger.getId(); if( !writtenIds.contains(id) ) writtenIds.add(id); String line = trigger.getId() + "\t" + trigger.getSpecificType() + " " + trigger.getBegin() + " " + trigger.getEnd() + "\t" + documentText.substring(trigger.getBegin(), trigger.getEnd()) + "\n"; writer.write(line); } }
EventTriggerWriter { public void writeTrigger(EventTrigger trigger) throws IOException { String id = trigger.getId(); if( !writtenIds.contains(id) ) writtenIds.add(id); String line = trigger.getId() + "\t" + trigger.getSpecificType() + " " + trigger.getBegin() + " " + trigger.getEnd() + "\t" + documentText.substring(trigger.getBegin(), trigger.getEnd()) + "\n"; writer.write(line); } EventTriggerWriter(Writer writer, String documentText); }
EventTriggerWriter { public void writeTrigger(EventTrigger trigger) throws IOException { String id = trigger.getId(); if( !writtenIds.contains(id) ) writtenIds.add(id); String line = trigger.getId() + "\t" + trigger.getSpecificType() + " " + trigger.getBegin() + " " + trigger.getEnd() + "\t" + documentText.substring(trigger.getBegin(), trigger.getEnd()) + "\n"; writer.write(line); } EventTriggerWriter(Writer writer, String documentText); Writer getFileWriter(); void setFileWriter(Writer writer); void writeTrigger(EventTrigger trigger); void close(); boolean isWritten(EventTrigger trigger); }
EventTriggerWriter { public void writeTrigger(EventTrigger trigger) throws IOException { String id = trigger.getId(); if( !writtenIds.contains(id) ) writtenIds.add(id); String line = trigger.getId() + "\t" + trigger.getSpecificType() + " " + trigger.getBegin() + " " + trigger.getEnd() + "\t" + documentText.substring(trigger.getBegin(), trigger.getEnd()) + "\n"; writer.write(line); } EventTriggerWriter(Writer writer, String documentText); Writer getFileWriter(); void setFileWriter(Writer writer); void writeTrigger(EventTrigger trigger); void close(); boolean isWritten(EventTrigger trigger);  }