Index: Document.java
===================================================================
RCS file: /home/cvspublic/jakarta-lucene/src/java/org/apache/lucene/document/Document.java,v
retrieving revision 1.14
diff -u -r1.14 Document.java
--- Document.java 1 Mar 2004 17:32:50 -0000 1.14
+++ Document.java 25 Mar 2004 17:27:14 -0000
@@ -113,8 +113,9 @@
}
/** Returns a field with the given name if any exist in this document, or
- null. If multiple fields exists with this name, this method returns the
- last field value added. */
+ null. If multiple fields exists with this name, this method returns the
+ last field value added. Note that you cannot get the value
+ of fields which are not stored. */
public final Field getField(String name) {
for (int i = 0; i < fields.size(); i++) {
Field field = (Field)fields.get(i);
@@ -125,8 +126,9 @@
}
/** Returns the string value of the field with the given name if any exist in
- this document, or null. If multiple fields exist with this name, this
- method returns the last value added. */
+ this document, or null. If multiple fields exist with this name, this
+ method returns the last value added. Note that you cannot get the value
+ of fields which are not stored. */
public final String get(String name) {
Field field = getField(name);
if (field != null)
@@ -135,14 +137,20 @@
return null;
}
- /** Returns an Enumeration of all the fields in a document. */
+ /**
+ * For a document which has been indexed this will return an Enumeration of all
+ * fields which are stored. For a document that has not been indexed
+ * this will return an Enumeration of all fields (even the ones that are not
+ * stored).
+ */
public final Enumeration fields() {
return ((Vector)fields).elements();
}
/**
* Returns an array of {@link Field}s with the given name.
- * This method can return null.
+ * This method can return null. UnStored fields' names
+ * cannot be returned by this method.
*
* @param name the name of the field
* @return a Field[] array