Class Index
static org.cote.js.token.TokenStack
version
Static instance of TokenStackImpl.
This class participates in the engine library.
org.cote.js.token.TokenStackImpl
version
A class for storing stacks of variant values and filtering the stack by owner.
This class participates in the engine library.
Index
Object Index
- public Token (internal): Internal object used to store the references that comprise a token.
Property Index
- private enable_overstack: Allows Token objects to be overstacked, meaning that names do not have to be unique. Defaults to false.
- public object_config (internal): Object API structure for storing sub structures: object_config.pointers and object_config.status.
- public object_id (internal): Unique instance identifier.
- public object_type (internal): The type of this object.
- public object_version (internal): Version of the object class.
- public ready_state (internal): Object load and execution state. Follows: 0 unitialized, 1 through 3 variant, 4 ready, 5 destroyed.
Method Index
- public addToken: Adds a token with the specified name and value for the specified owner.
- public getObjectId: Returns the unique id of the object.
- public getObjectType: Returns the type of the object.
- public getObjectVersion: Returns the version of the object.
- public getPointers: Returns the object_config.pointers sub structure.
- public getReadyState: Returns the state of the object.
- public getStatus: Returns the object_config.status sub structure.
- public getToken: Returns the specified token.
- public getTokenByOwner: Returns the specified token.
- public getTokens: Returns an array of tokens that match the specified name.
- public getTokensByOwner: Returns all tokens for the specified owner.
- public getTokenValue: Returns the value of the specified token.
- public removeToken: Removes all tokens for the specified owner.
- public removeTokens: Removes all tokens for the specified owner.
Objects
Token
Internal object used to store the references that comprise a token.
Properties
- owner_id as String: The id of the Token owner.
- index as int: The index of the Token in the local stack.
- token_name as String: The specified name of the token.
- token_value as variant: The specified value of the token.
Properties
enable_overstack
Allows Token objects to be overstacked, meaning that names do not have to be unique. Defaults to false. Property is private and should not be directly referenced.
Syntax
= object.enable_overstack
object.enable_overstack =
object_config
Object API structure for storing sub structures: object_config.pointers and object_config.status.
Syntax
object = object.object_config
object_id
Unique instance identifier.
Syntax
String = object.object_id
object_type
The type of this object.
Syntax
String = object.object_type
object_version
Version of the object class.
Syntax
String = object.object_version
ready_state
Object load and execution state. Follows: 0 unitialized, 1 through 3 variant, 4 ready, 5 destroyed.
Syntax
int = object.ready_state
Methods
addToken
Adds a token with the specified name and value for the specified owner.
Syntax
r = addToken(
o, n, v, b
)
Parameters
- o as object : Registered object that will own the token.
- n as String : Name of the token.
- v as variant : Value of the token.
- b as boolean (optional): Bit indicating whether a token with the same name for the same owner should be overwritten with the new value if it exists. If overstacking is enabled, the new value would be added without overwriting.
Returns
r as boolean: Bit indicating whether the token was added.
getObjectId
Returns the unique id of the object.
Syntax
i = getObjectId(
)
Returns
i as String: The unique object instance id.
getObjectType
Returns the type of the object.
Syntax
t = getObjectType(
)
Returns
t as String: The type of the object instance.
getObjectVersion
Returns the version of the object.
Syntax
v = getObjectVersion(
)
Returns
v as String: The version of the object instance.
getPointers
Returns the object_config.pointers sub structure.
Syntax
o = getPointers(
)
Returns
o as object: The object_config.pointers substructure.
getReadyState
Returns the state of the object.
Syntax
s = getReadyState(
)
Returns
s as int: The object ready state.
getStatus
Returns the object_config.status sub structure.
Syntax
o = getStatus(
)
Returns
o as object: The object_config.status substructure.
getToken
Returns the specified token.
Syntax
r = getToken(
n, i
)
Parameters
- n as String : Name of the token.
- i as int (optional): Index of the array for this token name to use to retrieve the value.
Returns
r as Token: The specified token object.
getTokenByOwner
Returns the specified token.
Syntax
r = getTokenByOwner(
n, o
)
Parameters
- n as String : Name of the token.
- o as object : A registered object that owns a token with the specified name.
Returns
r as Token: The specified token object belonging to the specified owner.
getTokens
Returns an array of tokens that match the specified name.
Syntax
a = getTokens(
n
)
Parameters
- n as String : Name of the token.
Returns
a as array: Array of tokens that match the specified name.
getTokensByOwner
Returns all tokens for the specified owner.
Syntax
r = getTokensByOwner(
o
)
Parameters
- o as object : A registered object that owns one or more tokens.
Returns
r as array: Array of tokens belonging to the specified owner.
getTokenValue
Returns the value of the specified token.
Syntax
r = getTokenValue(
n, i
)
Parameters
- n as String : Name of the token.
- i as int (optional): Index of the array for this token name to use to retrieve the value.
Returns
r as variant: The value of the specified token.
removeToken
Removes all tokens for the specified owner.
Syntax
void removeToken(
o, n
)
Parameters
- o as object : A registered object that owns one or more tokens.
- n as String : The name of a token.
removeTokens
Removes all tokens for the specified owner.
Syntax
void removeTokens(
o
)
Parameters
- o as object : A registered object that owns one or more tokens.