|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mobi.voiceassistant.base.Scope
public final class Scope
Scope is a mapping of some ResId
which denotes module to
some ComponentName
which denotes Agent
. It also contains some specification how
Response
and further requests should be handled.
Response.enterScope(Scope)
,
PendingInput
Field Summary | |
---|---|
static int |
MODE_FOREIGN
Input in foreign scopes handled in specified locale instead of assistant's default. |
static int |
MODE_MODAL
Modal scopes match instead of root ones. |
static int |
MODE_QUESTION
Question scope means that more input from user is expected. |
Constructor Summary | |
---|---|
Scope(ComponentName component,
ResId module,
int mode)
|
|
Scope(ComponentName component,
ResId module,
int mode,
Locale locale)
|
Method Summary | |
---|---|
ComponentName |
getComponent()
Returns component for this scope passed to constructor. |
Locale |
getLocale()
Returns locale for this scope passed to Scope(ComponentName, ResId, int, Locale) . |
int |
getMode()
Returns mode for this scope passed to constructor. |
ResId |
getModuleResource()
Returns module id for this scope passed to constructor. |
static Scope |
readFromParcel(Parcel parcel)
|
static void |
writeToParcel(Scope scope,
Parcel parcel,
int flags)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MODE_MODAL
Scope(ComponentName, ResId, int)
,
Scope(ComponentName, ResId, int, Locale)
,
getMode()
,
Constant Field Valuespublic static final int MODE_FOREIGN
MODE_MODAL
Scope(ComponentName, ResId, int, Locale)
,
getLocale()
,
getMode()
,
Constant Field Valuespublic static final int MODE_QUESTION
Scope(ComponentName, ResId, int)
,
Scope(ComponentName, ResId, int, Locale)
,
getMode()
,
Constant Field ValuesConstructor Detail |
---|
public Scope(ComponentName component, ResId module, int mode)
component
- Component pair of mappingmodule
- Module pair of mappingmode
- Scope's mode
IllegalArgumentException
- if mode
contains MODE_FOREIGN
Scope(ComponentName, ResId, int, Locale)
,
MODE_MODAL
,
MODE_FOREIGN
,
MODE_QUESTION
public Scope(ComponentName component, ResId module, int mode, Locale locale)
component
- Component pair of mappingmodule
- Module pair of mappingmode
- Scope's modelocale
- Scope's locale or null
for assistant's default locale.
IllegalArgumentException
- if mode
contains MODE_FOREIGN
and
locale
is null
or has empty language code.MODE_MODAL
,
MODE_FOREIGN
,
MODE_QUESTION
Method Detail |
---|
public int getMode()
MODE_MODAL
,
MODE_FOREIGN
,
MODE_QUESTION
,
Scope(ComponentName, ResId, int)
,
Scope(ComponentName, ResId, int, Locale)
public ComponentName getComponent()
Scope(ComponentName, ResId, int)
,
Scope(ComponentName, ResId, int, Locale)
public ResId getModuleResource()
Scope(ComponentName, ResId, int)
,
Scope(ComponentName, ResId, int, Locale)
public Locale getLocale()
Scope(ComponentName, ResId, int, Locale)
.
Returns null
for not foreign scopes.
MODE_FOREIGN
public static Scope readFromParcel(Parcel parcel)
public static void writeToParcel(Scope scope, Parcel parcel, int flags)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |