19 using Lucene.Net.Support;
23 namespace Lucene.Net.Index
29 private System.String field;
31 private bool preUTF8Strings;
39 if ((System.Object) field == (System.Object) other.field)
41 return CompareChars(text.result, text.length, other.text.result, other.text.length);
43 return String.CompareOrdinal(field, other.field);
46 private static int CompareChars(
char[] chars1,
int len1,
char[] chars2,
int len2)
48 int end = len1 < len2?len1:len2;
49 for (
int k = 0; k < end; k++)
65 internal void SetPreUTF8Strings()
67 preUTF8Strings =
true;
73 int start = input.ReadVInt();
74 int length = input.ReadVInt();
75 int totalLength = start + length;
78 text.SetLength(totalLength);
79 input.ReadChars(text.result, start, length);
87 UnicodeUtil.UTF16toUTF8(text.result, 0, text.length, bytes);
88 bytes.SetLength(totalLength);
89 input.ReadBytes(bytes.result, start, length);
90 UnicodeUtil.UTF8toUTF16(bytes.result, 0, totalLength, text);
96 bytes.SetLength(totalLength);
97 input.ReadBytes(bytes.result, start, length);
98 UnicodeUtil.UTF8toUTF16(bytes.result, start, length, text);
101 this.field = fieldInfos.
FieldName(input.ReadVInt());
111 System.String termText = term.
Text;
112 int termLen = termText.Length;
113 text.SetLength(termLen);
122 text.CopyText(other.text);
143 term =
new Term(field,
new System.String(text.result, 0, text.length),
false);
148 public System.Object Clone()
155 catch (System.Exception)
162 clone.text.CopyText(text);