Next: Method Proxies, Previous: Static Members, Up: Classes [Contents]
2.4 Abstract Members
'abstract [keywords] name': params
Declare an abstract method name as having params parameters, having optional additional keywords keywords.
Abstract members permit declaring an API, deferring the implementation to a subtype. Abstract methods are declared as an array of string parameter names params.
// declares abstract method 'connect' expecting the two parameters, // 'host' and 'path' { 'abstract connect': [ 'host', 'path' ] }
- Abstract members are defined using the
abstract
keyword.- Except in interfaces (see Interfaces), where the
abstract
keyword is implicit.
- Except in interfaces (see Interfaces), where the
- Currently, only methods may be declared abstract.
- The subtype must implement at least the number of parameters declared in
params, but the names needn’t match.
- Each name in params must be a valid variable name, as satisfied by
the regular expression
/^[a-z_][a-z0-9_]*$/i
. - The names are use purely for documentation and are not semantic.
- Each name in params must be a valid variable name, as satisfied by
the regular expression
Abstract members may only be a part of one of the following:
• Interfaces: | ||
• Abstract Classes: |