|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.appengine.api.search.Field
public final class Field
Represents a field of a Document
, which is a name, an optional
locale, and at most one value: text, HTML, atom or date. Field
name lengths are between 1 and FieldChecker.MAXIMUM_NAME_LENGTH
characters, and text and HTML values are limited to
FieldChecker.MAXIMUM_TEXT_LENGTH
. Atoms as limited to
FieldChecker.MAXIMUM_ATOM_LENGTH
characters, and dates
must not have a time component.
There are 3 types of text fields, ATOM, TEXT, and HTML. Atom fields
when queried, are checked for equality. For example, if you add a field
with name code
and an ATOM value of "928A 33B-1", then query
code:"928A 33B-1"
would match the document with this field, while
query code:928A
would not. TEXT fields, unlike ATOM, match both
on equality or if any token extracted from the original field matches.
Thus if code
field had the value set with
Field.Builder.setText(String)
method, both queries would match.
Finally, HTML fields have HTML tags stripped before tokenization.
Nested Class Summary | |
---|---|
static class |
Field.Builder
A field builder. |
static class |
Field.FieldType
The type of the field value. |
Method Summary | |
---|---|
static java.util.Date |
date(java.util.Date date)
Returns a date which has been truncated to a day of month. |
boolean |
equals(java.lang.Object object)
|
java.lang.String |
getAtom()
|
java.util.Date |
getDate()
|
java.lang.String |
getHTML()
|
java.util.Locale |
getLocale()
|
java.lang.String |
getName()
|
java.lang.Double |
getNumber()
|
java.lang.String |
getText()
|
Field.FieldType |
getType()
|
int |
hashCode()
|
static Field.Builder |
newBuilder()
Creates a field builder. |
java.lang.String |
toString()
|
static java.util.Date |
truncate(java.util.Date date,
int field)
Truncates given date leaving date elements lesser than the specified field set to 0. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public java.lang.String getName()
public Field.FieldType getType()
public java.lang.String getText()
public java.lang.String getHTML()
public java.lang.String getAtom()
public java.util.Date getDate()
public java.lang.Double getNumber()
public java.util.Locale getLocale()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public static Field.Builder newBuilder()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.util.Date date(java.util.Date date)
date
- the date to be truncated
Calendar.DAY_OF_MONTH
public static java.util.Date truncate(java.util.Date date, int field)
Date d = ... Date yearMonthDay = Field.truncate(d, Calendar.DAY_OF_MONTH);
date
- the date to be truncatedfield
- the least significant field to be left untouched
java.lang.IllegalArgumentException
- if field is not a valid datetime field.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |