Package com.microblink.photopay.entities
Class Entity<T extends Entity.Result>
java.lang.Object
com.microblink.photopay.entities.Entity<T>
- All Implemented Interfaces:
android.os.Parcelable
- Direct Known Subclasses:
Parser,Processor,Recognizer
public abstract class Entity<T extends Entity.Result>
extends Object
implements android.os.Parcelable
Represents an entity that can be process a step during recognition.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Entityclone()Create a copy of the entity.abstract voidconsumeResultFrom(Entity other) Consume result from other entity.intprotected abstract voiddeserializeNativeSettings(byte[] serializedSettings) protected voidfinalize()final longfinal TReturns the last result of the entity.protected static longnativeGetNativeResultContext(long nativeContext) protected voidreadFromParcel(android.os.Parcel in) protected abstract byte[]protected abstract voidterminateNative(long nativeContext) voidwriteToParcel(android.os.Parcel dest, int i)
-
Constructor Details
-
Entity
-
Entity
-
-
Method Details
-
nativeGetNativeResultContext
protected static long nativeGetNativeResultContext(long nativeContext) -
finalize
-
describeContents
public int describeContents()- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
getNativeContext
public final long getNativeContext() -
terminateNative
protected abstract void terminateNative(long nativeContext) -
serializeNativeSettings
@Nullable protected abstract byte[] serializeNativeSettings() -
deserializeNativeSettings
protected abstract void deserializeNativeSettings(@NonNull byte[] serializedSettings) -
clone
Create a copy of the entity. This is required if properties of the entity must be modified while background thread performs processing. In order to avoid race conditions, changing properties is not allowed while entity is used in background processing. However, you are able to make a copy of the entity, change properties of it and then update theRecognizerRunnerVieworRecognizerRunnerwith the updated entity hierarchy. -
consumeResultFrom
Consume result from other entity. The result from other will be put instead current result of this entity. This method is used insideBaseIntentTransferable.loadFromIntent(Intent)and similar methods to replace the result content of the saved entities with results that have arrived overIntent- Parameters:
other- Entity from which result should be consumed.
-
writeToParcel
@CallSuper public void writeToParcel(@NonNull android.os.Parcel dest, int i) - Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-
readFromParcel
@CallSuper protected void readFromParcel(@NonNull android.os.Parcel in) -
getResult
Returns the last result of the entity.- Returns:
- the last result of the entity.
-