lcsim/src/org/lcsim/util/loop
diff -u -r1.6 -r1.7
--- LCIODriver.java 27 Mar 2007 17:14:29 -0000 1.6
+++ LCIODriver.java 30 Apr 2007 23:58:54 -0000 1.7
@@ -3,6 +3,7 @@
import java.io.File;
import java.io.IOException;
import java.util.Collection;
+import java.util.Collections;
import org.lcsim.event.EventHeader;
import org.lcsim.util.Driver;
import org.lcsim.util.lcio.LCIOWriter;
@@ -15,42 +16,32 @@
{
private LCIOWriter writer;
private String file;
+ private Collection<String> listIgnore;
public LCIODriver(String file)
{
this.file = file;
- }
+ }
public LCIODriver(File file)
{
this.file = file.getAbsolutePath();
- }
- protected void startOfData()
- {
- try
- {
- writer = new LCIOWriter(file);
- }
- catch (IOException x)
- {
- throw new RuntimeException("Error opening LCIO file",x);
- }
}
public LCIODriver(String file, Collection<String> listIgnore)
{
- try
- {
- writer = new LCIOWriter(file, listIgnore);
- }
- catch (IOException x)
- {
- throw new RuntimeException("Error opening LCIO file",x);
- }
+ this.file = file;
+ this.listIgnore = listIgnore;
+
}
public LCIODriver(File file, Collection<String> listIgnore)
{
+ this.file = file.getAbsolutePath();
+ this.listIgnore = listIgnore;
+ }
+ protected void startOfData()
+ {
try
{
- writer = new LCIOWriter(file, listIgnore);
+ writer = new LCIOWriter(file,listIgnore == null ? Collections.EMPTY_SET : listIgnore);
}
catch (IOException x)
{
@@ -67,8 +58,8 @@
{
throw new RuntimeException("Error writing LCIO file",x);
}
- }
-
+ }
+
protected void endOfData()
{
try