From 61f2aa3078d7d7594530ffe3a7bd4ffc890b754c Mon Sep 17 00:00:00 2001 From: Grant Ingersoll Date: Wed, 30 Jan 2008 20:03:39 +0000 Subject: [PATCH] allow TrecDocMaker to be more easily extended by making values protected git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@616882 13f79535-47bb-0310-9956-ffa450edef68 --- .../benchmark/byTask/feeds/TrecDocMaker.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocMaker.java b/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocMaker.java index 221a7173d95..4e56a889eb2 100644 --- a/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocMaker.java +++ b/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocMaker.java @@ -46,12 +46,12 @@ public class TrecDocMaker extends BasicDocMaker { private static final String newline = System.getProperty("line.separator"); - private ThreadLocal dateFormat = new ThreadLocal(); - private File dataDir = null; - private ArrayList inputFiles = new ArrayList(); - private int nextFile = 0; - private int iteration=0; - private BufferedReader reader; + protected ThreadLocal dateFormat = new ThreadLocal(); + protected File dataDir = null; + protected ArrayList inputFiles = new ArrayList(); + protected int nextFile = 0; + protected int iteration=0; + protected BufferedReader reader; private GZIPInputStream zis; private static final String DATE_FORMATS [] = { @@ -78,7 +78,7 @@ public class TrecDocMaker extends BasicDocMaker { } } - private void openNextFile() throws NoMoreDataException, Exception { + protected void openNextFile() throws NoMoreDataException, Exception { closeInputs(); int retries = 0; while (true) { @@ -111,7 +111,7 @@ public class TrecDocMaker extends BasicDocMaker { } } - private void closeInputs() { + protected void closeInputs() { if (zis!=null) { try { zis.close(); @@ -133,7 +133,7 @@ public class TrecDocMaker extends BasicDocMaker { } // read until finding a line that starts with the specified prefix - private StringBuffer read (String prefix, StringBuffer sb, boolean collectMatchLine, boolean collectAll) throws Exception { + protected StringBuffer read (String prefix, StringBuffer sb, boolean collectMatchLine, boolean collectAll) throws Exception { sb = (sb==null ? new StringBuffer() : sb); String sep = ""; while (true) { @@ -186,7 +186,7 @@ public class TrecDocMaker extends BasicDocMaker { return docData; } - private DateFormat getDateFormat(int n) { + protected DateFormat getDateFormat(int n) { DateFormat df[] = (DateFormat[]) dateFormat.get(); if (df == null) { df = new SimpleDateFormat[DATE_FORMATS.length]; @@ -199,7 +199,7 @@ public class TrecDocMaker extends BasicDocMaker { return df[n]; } - private Date parseDate(String dateStr) { + protected Date parseDate(String dateStr) { Date date = null; for (int i=0; i