vgritsenko 2003/08/07 18:05:50
Modified: java/src/org/apache/xindice/core/indexer
MemValueIndexer.java
java/src/org/apache/xindice/core/meta MetaData.java
java/src/org/apache/xindice/core/meta/inline
InlineHeaderBuilder.java
java/src/org/apache/xindice/server/rpc/messages
GetCollectionConfiguration.java
java/src/org/apache/xindice/tools XMLTools.java
Log:
Remove/comment unused code.
Revision Changes Path
1.5 +102 -97
xml-xindice/java/src/org/apache/xindice/core/indexer/MemValueIndexer.java
Index: MemValueIndexer.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/indexer/MemValueIndexer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MemValueIndexer.java 7 Aug 2003 20:13:21 -0000 1.4
+++ MemValueIndexer.java 8 Aug 2003 01:05:50 -0000 1.5
@@ -96,6 +96,92 @@
*/
private static final Log log = LogFactory.getLog(MemValueIndexer.class);
+ //
+ // Class constants
+ //
+
+ private static final int STRING = 0;
+ private static final int TRIMMED = 1;
+ private static final int SHORT = 2;
+ private static final int INTEGER = 3;
+ private static final int LONG = 4;
+ private static final int FLOAT = 5;
+ private static final int DOUBLE = 6;
+ private static final int BYTE = 7;
+ private static final int CHAR = 8;
+ private static final int BOOLEAN = 9;
+
+ private static final String NAME = "name";
+ private static final String PATTERN = "pattern";
+ private static final String TYPE = "type";
+ // private static final String PAGESIZE = "pagesize";
+ // private static final String MAXKEYSIZE = "maxkeysize";
+
+ private static final String STRING_VAL = "string";
+ private static final String TRIMMED_VAL = "trimmed";
+ private static final String SHORT_VAL = "short";
+ private static final String INT_VAL = "int";
+ private static final String LONG_VAL = "long";
+ private static final String FLOAT_VAL = "float";
+ private static final String DOUBLE_VAL = "double";
+ private static final String BYTE_VAL = "byte";
+ private static final String CHAR_VAL = "char";
+ private static final String BOOLEAN_VAL = "boolean";
+
+ //
+ // Instance variables
+ //
+
+ /**
+ * TODO: Unused: the indexed Collection
+ private org.apache.xindice.core.Collection itsCollection;
+ */
+
+ /**
+ * this object's configuration
+ */
+ private Configuration itsConfig;
+
+ /**
+ * name of this index
+ */
+ private String itsName;
+
+ /**
+ * pattern for this index
+ */
+ private String itsPattern;
+
+ /**
+ * TODO: Unused: indicates if wildcard index
+ private boolean itsWildcard = false;
+ */
+
+ /**
+ * value type of this index
+ */
+ private int itsValueType = STRING;
+
+ /**
+ * value type name of this index
+ */
+ private String itsValueTypeName = STRING_VAL;
+
+ /**
+ * storage for map of values to tree Key objects locating value matches
in Collection
+ */
+ private TreeMap itsValues = null;
+
+ /**
+ * count of ValueLocator objects we currently manage
+ */
+ private int itsValueLocatorCount = 0;
+
+ /**
+ * tracks the open/closed state for open(), close(), and isOpened()
+ */
+ private boolean itsOpen = false;
+
/**
* Sets the parent Collection of this indexer.
@@ -103,7 +189,7 @@
* @param theCollection The owner Collection
*/
public void setCollection(org.apache.xindice.core.Collection
theCollection) {
- itsCollection = theCollection;
+ // TODO: Unused: itsCollection = theCollection;
}
/**
@@ -765,38 +851,35 @@
try {
itsName = theConfig.getAttribute(NAME);
itsPattern = theConfig.getAttribute(PATTERN);
- itsWildcard = itsPattern.indexOf('*') != -1;
+ // TODO: Unused: itsWildcard = itsPattern.indexOf('*') != -1;
// Determine the Index Type
- String itsValueTypeName = theConfig.getAttribute(TYPE,
STRING_VAL).toLowerCase();
-
- if (itsValueTypeName.equals(STRING_VAL))
+ String type = theConfig.getAttribute(TYPE,
STRING_VAL).toLowerCase();
+ if (type.equals(STRING_VAL)) {
itsValueType = STRING;
- else if (itsValueTypeName.equals(TRIMMED_VAL))
+ } else if (type.equals(TRIMMED_VAL)) {
itsValueType = TRIMMED;
- else if (itsValueTypeName.equals(SHORT_VAL))
+ } else if (type.equals(SHORT_VAL)) {
itsValueType = SHORT;
- else if (itsValueTypeName.equals(INT_VAL))
+ } else if (type.equals(INT_VAL)) {
itsValueType = INTEGER;
- else if (itsValueTypeName.equals(LONG_VAL))
+ } else if (type.equals(LONG_VAL)) {
itsValueType = LONG;
- else if (itsValueTypeName.equals(FLOAT_VAL))
+ } else if (type.equals(FLOAT_VAL)) {
itsValueType = FLOAT;
- else if (itsValueTypeName.equals(DOUBLE_VAL))
+ } else if (type.equals(DOUBLE_VAL)) {
itsValueType = DOUBLE;
- else if (itsValueTypeName.equals(BYTE_VAL))
+ } else if (type.equals(BYTE_VAL)) {
itsValueType = BYTE;
- else if (itsValueTypeName.equals(CHAR_VAL))
+ } else if (type.equals(CHAR_VAL)) {
itsValueType = CHAR;
- else if (itsValueTypeName.equals(BOOLEAN_VAL))
+ } else if (type.equals(BOOLEAN_VAL)) {
itsValueType = BOOLEAN;
- else {
+ } else {
if (itsPattern.indexOf('@') != -1) {
itsValueType = STRING;
- itsValueTypeName = STRING_VAL;
} else {
itsValueType = TRIMMED;
- itsValueTypeName = TRIMMED_VAL;
}
}
} catch (Exception anException) {
@@ -1141,84 +1224,6 @@
}
return theStartIndex;
}
-
- /**
- * the indexed Collection
- */
- private org.apache.xindice.core.Collection itsCollection;
-
- /**
- * this object's configuration
- */
- private Configuration itsConfig;
-
- /**
- * name of this index
- */
- private String itsName;
-
- /**
- * pattern for this index
- */
- private String itsPattern;
-
- /**
- * indicates if wildcard index
- */
- private boolean itsWildcard = false;
-
- /**
- * value type of this index
- */
- private int itsValueType = STRING;
-
- /**
- * value type name of this index
- */
- private String itsValueTypeName = STRING_VAL;
-
- /**
- * storage for map of values to tree Key objects locating value matches
in Collection
- */
- private TreeMap itsValues = null;
-
- /**
- * count of ValueLocator objects we currently manage
- */
- private int itsValueLocatorCount = 0;
-
- /**
- * tracks the open/closed state for open(), close(), and isOpened()
- */
- private boolean itsOpen = false;
-
- private static final String NAME = "name";
- private static final String PATTERN = "pattern";
- private static final String TYPE = "type";
- // private static final String PAGESIZE = "pagesize";
- // private static final String MAXKEYSIZE = "maxkeysize";
-
- private static final String STRING_VAL = "string";
- private static final String TRIMMED_VAL = "trimmed";
- private static final String SHORT_VAL = "short";
- private static final String INT_VAL = "int";
- private static final String LONG_VAL = "long";
- private static final String FLOAT_VAL = "float";
- private static final String DOUBLE_VAL = "double";
- private static final String BYTE_VAL = "byte";
- private static final String CHAR_VAL = "char";
- private static final String BOOLEAN_VAL = "boolean";
-
- private static final int STRING = 0;
- private static final int TRIMMED = 1;
- private static final int SHORT = 2;
- private static final int INTEGER = 3;
- private static final int LONG = 4;
- private static final int FLOAT = 5;
- private static final int DOUBLE = 6;
- private static final int BYTE = 7;
- private static final int CHAR = 8;
- private static final int BOOLEAN = 9;
/**
* Implements an Object representing any empty value.
1.6 +9 -5
xml-xindice/java/src/org/apache/xindice/core/meta/MetaData.java
Index: MetaData.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/meta/MetaData.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- MetaData.java 7 Aug 2003 20:13:22 -0000 1.5
+++ MetaData.java 8 Aug 2003 01:05:50 -0000 1.6
@@ -430,6 +430,7 @@
*/
public final Element streamToXML(Document doc, boolean includeTime)
throws DOMException {
+
Element root = null;
if (!USE_NS) {
root = doc.createElement(E_META);
@@ -437,7 +438,8 @@
root = doc.createElementNS(NS_URI, E_META);
root.setAttribute("xmlns", NS_URI);
}
-/*
+
+ /*
* Usage of streamToXML seems to be vectored through
* Collection.putObject(), which adds the element returned
* by streamToXML to the document. That makes the most sense
@@ -514,12 +516,14 @@
attrsElement.appendChild(attrElement);
attrElement.setAttribute(A_NAME, key.toString());
- if (null != value)
+ if (null != value) {
attrElement.setAttribute(A_VALUE, value.toString());
+ }
}
}
if (null != custom) {
+ // TODO: customElement is not used. Bug?
Element customElement = null;
if (!USE_NS) {
customElement = doc.createElement(E_CUSTOM);
@@ -568,7 +572,7 @@
Element element = (Element) node;
String elementName = element.getNodeName();
- String prefix = element.getPrefix();
+ // String prefix = element.getPrefix();
if (systemElemName.equals(elementName)) {
String attrStr = element.getAttribute(A_TYPE);
1.5 +2 -6
xml-xindice/java/src/org/apache/xindice/core/meta/inline/InlineHeaderBuilder.java
Index: InlineHeaderBuilder.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/meta/inline/InlineHeaderBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- InlineHeaderBuilder.java 7 Aug 2003 20:13:22 -0000 1.4
+++ InlineHeaderBuilder.java 8 Aug 2003 01:05:50 -0000 1.5
@@ -59,8 +59,6 @@
package org.apache.xindice.core.meta.inline;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.xindice.core.data.Value;
/**
@@ -87,8 +85,6 @@
* @version CVS $Revision$, $Date$
*/
public class InlineHeaderBuilder {
-
- private static final Log log =
LogFactory.getLog(InlineHeaderBuilder.class);
/**
* There's no reason to ever create an instance of this class.
1.9 +2 -3
xml-xindice/java/src/org/apache/xindice/server/rpc/messages/GetCollectionConfiguration.java
Index: GetCollectionConfiguration.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/server/rpc/messages/GetCollectionConfiguration.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- GetCollectionConfiguration.java 7 Aug 2003 20:13:23 -0000 1.8
+++ GetCollectionConfiguration.java 8 Aug 2003 01:05:50 -0000 1.9
@@ -59,7 +59,6 @@
package org.apache.xindice.server.rpc.messages;
-import org.apache.xindice.core.Collection;
import org.apache.xindice.server.rpc.RPCDefaultMessage;
import java.util.Hashtable;
1.23 +8 -13
xml-xindice/java/src/org/apache/xindice/tools/XMLTools.java
Index: XMLTools.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/tools/XMLTools.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- XMLTools.java 7 Aug 2003 20:13:24 -0000 1.22
+++ XMLTools.java 8 Aug 2003 01:05:50 -0000 1.23
@@ -59,14 +59,6 @@
package org.apache.xindice.tools;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.util.Hashtable;
-import java.util.NoSuchElementException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.xindice.client.xmldb.DatabaseImpl;
import org.apache.xindice.server.Xindice;
import org.apache.xindice.tools.command.Command;
@@ -77,11 +69,16 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
-
import org.xmldb.api.DatabaseManager;
import org.xmldb.api.base.Database;
import org.xmldb.api.base.XMLDBException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.util.Hashtable;
+import java.util.NoSuchElementException;
+
/**
* XMLAdmin is designed to take command line arguments and give
* user Xindice management flexibility within the current Database.
@@ -89,8 +86,6 @@
* @version CVS $Revision$, $Date$
*/
public class XMLTools {
-
- private static final Log log = LogFactory.getLog(XMLTools.class);
public static final String COLLECTION = "collection";
public static final String EXTENSION = "extension";