Index: Term.java
===================================================================
RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/Term.java,v
retrieving revision 1.3
diff -u -r1.3 Term.java
--- Term.java	15 Feb 2002 13:13:19 -0000	1.3
+++ Term.java	23 Oct 2002 21:19:53 -0000
@@ -62,10 +62,15 @@
   Note that terms may represent more than words from text fields, but also
   things like dates, email addresses, urls, etc.  */
 
-public final class Term implements java.io.Serializable {
+public final class Term implements java.io.Serializable, Cloneable {
   String field;
   String text;
-  
+
+  public Object clone()
+  {
+      return new Term(field, text, true);
+  }
+
   /** Constructs a Term with the given field and text. */
   public Term(String fld, String txt) {
     this(fld, txt, true);
@@ -113,14 +118,25 @@
   /** Resets the field and text of a Term. */
   final void set(String fld, String txt) {
     field = fld;
+    field.intern();
     text = txt;
   }
 
+  public void setField(String fld)
+  {
+      this.field = fld;
+      field.intern();
+  }
+  public void setText(String text)
+  {
+      this.text = text;
+  }
+
   public final String toString() {
     return "Term<" + field + ":" + text + ">";
   }
-  
-  private void readObject(java.io.ObjectInputStream in) 
+
+  private void readObject(java.io.ObjectInputStream in)
     throws java.io.IOException, ClassNotFoundException
   {
       in.defaultReadObject();

