Class Date
java.lang.Object
com.microblink.blinkid.results.date.Date
- All Implemented Interfaces:
android.os.Parcelable
,SimpleDateResult
Helper class for obtaining date results.
-
Nested Class Summary
-
Field Summary
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Method Summary
Modifier and TypeMethodDescriptionstatic Date
createFromDMY
(int day, int month, int year, String originalDateString, boolean isFilledByDomainKnowledge) This method is called from native code to buildDate
from native object.static Date
createUnparsed
(String originalDateString, boolean isFilledByDomainKnowledge) This method is called from native code to buildDate
from native object, when date has not been successfully parsed from the givenoriginalDateString
.int
getDate()
Date getter, ifSimpleDate
representation of date result exists returns it, otherwise returns null.Returns original string representation of the date which has been extracted from the OCR result.boolean
Indicates that date does not appear on the document but is filled by our internal domain knowledge.toString()
void
writeToParcel
(android.os.Parcel parcel, int i)
-
Field Details
-
CREATOR
-
-
Method Details
-
getOriginalDateString
Returns original string representation of the date which has been extracted from the OCR result. If it is successfully parsed toSimpleDate
object, it can be obtained by usinggetDate()
method.- Returns:
- original string representation of the date which has been extracted from the OCR result
-
isFilledByDomainKnowledge
public boolean isFilledByDomainKnowledge()Indicates that date does not appear on the document but is filled by our internal domain knowledge.- Returns:
- true if the date is filled by our internal domain knowledge
-
getDate
Date getter, ifSimpleDate
representation of date result exists returns it, otherwise returns null. To obtain original date string usegetOriginalDateString()
method.- Specified by:
getDate
in interfaceSimpleDateResult
- Returns:
- if
SimpleDate
representation of date result exists returns it, otherwise returns null.
-
createFromDMY
@NonNull public static Date createFromDMY(int day, int month, int year, @NonNull String originalDateString, boolean isFilledByDomainKnowledge) This method is called from native code to buildDate
from native object.- Parameters:
day
- day of the monthmonth
- month of the year from interval [1,12]year
- full yearoriginalDateString
- original string from which native object has been parsed- Returns:
Date
object
-
createUnparsed
@NonNull public static Date createUnparsed(@NonNull String originalDateString, boolean isFilledByDomainKnowledge) This method is called from native code to buildDate
from native object, when date has not been successfully parsed from the givenoriginalDateString
.- Parameters:
originalDateString
- original string from which native object has been created and which has not been successfully parsed to date.- Returns:
Date
object
-
describeContents
public int describeContents()- Specified by:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(@NonNull android.os.Parcel parcel, int i) - Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-
toString
-