Package com.libremobileos.yifan.face
Class SharedPreferencesFaceStorageBackend
- java.lang.Object
-
- com.libremobileos.yifan.face.FaceStorageBackend
-
- com.libremobileos.yifan.face.SharedPreferencesFaceStorageBackend
-
public class SharedPreferencesFaceStorageBackend extends FaceStorageBackend
FaceStorageBackend
storing data inSharedPreferences
-
-
Constructor Summary
Constructors Constructor Description SharedPreferencesFaceStorageBackend(SharedPreferences prefs)
Create/loadSharedPreferencesFaceStorageBackend
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
deleteInternal(String name)
Delete all references to a face.protected String
getInternal(String name)
Load 2D face model from storage.protected Set<String>
getNamesInternal()
Get all known facesprotected boolean
registerInternal(String name, String data, boolean replace)
Register/store new face.-
Methods inherited from class com.libremobileos.yifan.face.FaceStorageBackend
delete, extendRegistered, get, getNames, register, register, register
-
-
-
-
Constructor Detail
-
SharedPreferencesFaceStorageBackend
public SharedPreferencesFaceStorageBackend(SharedPreferences prefs)
Create/loadSharedPreferencesFaceStorageBackend
- Parameters:
prefs
-SharedPreferences
to use
-
-
Method Detail
-
getNamesInternal
protected Set<String> getNamesInternal()
Description copied from class:FaceStorageBackend
Get all known faces- Specified by:
getNamesInternal
in classFaceStorageBackend
- Returns:
Set
of all known faces (names only)
-
registerInternal
protected boolean registerInternal(String name, String data, boolean replace)
Description copied from class:FaceStorageBackend
Register/store new face.- Specified by:
registerInternal
in classFaceStorageBackend
- Parameters:
name
- Name of the face, needs to be unique.data
- Face detection model data to store.replace
- Only true if we are adding a duplicate and want to replace the saved one.- Returns:
- If registering was successful.
-
getInternal
protected String getInternal(String name)
Description copied from class:FaceStorageBackend
Load 2D face model from storage.- Specified by:
getInternal
in classFaceStorageBackend
- Parameters:
name
- The name of the face to load.- Returns:
- The face model.
-
deleteInternal
protected boolean deleteInternal(String name)
Description copied from class:FaceStorageBackend
Delete all references to a face.- Specified by:
deleteInternal
in classFaceStorageBackend
- Parameters:
name
- The face to delete.- Returns:
- If deletion was successful.
-
-