DateTimeEntity

public final class DateTimeEntity extends Entity

A date-time entity extracted from a piece of text. It provides estimated values for the date-time expressed in the text.

Nested Class Summary

@interface DateTimeEntity.DateTimeGranularity The precision of a timestamp that was extracted from text. 

Constant Summary

Inherited Constant Summary

com.google.mlkit.nl.entityextraction.Entity
int TYPE_ADDRESS Identifies a physical address.
int TYPE_DATE_TIME Identifies a time reference that includes a specific time.
int TYPE_EMAIL Identifies an e-mail address.
int TYPE_FLIGHT_NUMBER Identifies a flight number in IATA format.
int TYPE_IBAN Identifies an International Bank Account Number (IBAN).
int TYPE_ISBN Identifies an International Standard Book Number (ISBN).
int TYPE_MONEY Identifies an amount of money.
int TYPE_PAYMENT_CARD Identifies a payment card.
int TYPE_PHONE Identifies a phone number.
int TYPE_TRACKING_NUMBER Identifies a shipment tracking number.
int TYPE_URL Identifies a URL.

Public Method Summary

int
getDateTimeGranularity()
Returns granularity (e.g.
long
getTimestampMillis()
The timestamp in milliseconds from the epoch of 1970-01-01T00:00:00Z (UTC timezone).

Inherited Method Summary

com.google.mlkit.nl.entityextraction.Entity
DateTimeEntity
asDateTimeEntity()
Convenience method that returns the current entity cast to a DateTimeEntity.
FlightNumberEntity
asFlightNumberEntity()
Convenience method that returns the current entity cast to a FlightNumberEntity.
IbanEntity
asIbanEntity()
Convenience method that returns the current entity cast to a IbanEntity.
IsbnEntity
asIsbnEntity()
Convenience method that returns the current entity cast to a IsbnEntity.
MoneyEntity
asMoneyEntity()
Convenience method that returns the current entity cast to a MoneyEntity.
PaymentCardEntity
asPaymentCardEntity()
Convenience method that returns the current entity cast to a PaymentCardEntity.
TrackingNumberEntity
asTrackingNumberEntity()
Convenience method that returns the current entity cast to a TrackingNumberEntity.
int
getType()
Returns the type(e.g.
String
Object
clone()
boolean
equals(Object arg0)
void
finalize()
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()

Constants

public static final int GRANULARITY_DAY

Constant Value: 3

public static final int GRANULARITY_HOUR

Constant Value: 4

public static final int GRANULARITY_MINUTE

Constant Value: 5

public static final int GRANULARITY_MONTH

Constant Value: 1

public static final int GRANULARITY_SECOND

Constant Value: 6

public static final int GRANULARITY_WEEK

Constant Value: 2

public static final int GRANULARITY_YEAR

Constant Value: 0

Public Methods

public int getDateTimeGranularity ()

Returns granularity (e.g. GRANULARITY_DAY) for the timestamp returned by getTimestampMillis().

public long getTimestampMillis ()

The timestamp in milliseconds from the epoch of 1970-01-01T00:00:00Z (UTC timezone).