Type IInterfaceDeclaration
Interface
--+
|
IInterfaceDeclaration
Declare and check the interfaces of objects
The functions defined in this interface are used to declare the
interfaces that objects provide and to query the interfaces that have
been declared.
Interfaces can be declared for objects in two ways:
- Interfaces are declared for instances of the object's class
- Interfaces are declared for the object directly.
The interfaces declared for an object are, therefore, the union of
interfaces declared for the object directly and the interfaces
declared for instances of the object's class.
Note that we say that a class implements the interfaces provided
by it's instances. An instance can also provide interfaces
directly. The interfaces provided by an object are the union of
the interfaces provided directly and the interfaces implemented by
the class.
Method Summary |
Inherited from InterfaceClass |
|
implementedBy (self,
cls)
Do instances of the given class implement the interface? |
|
providedBy (self,
ob)
Is the interface implemented by an object |
classImplements
-
- Type:
-
str
- Value:
'''Declare additional interfaces implemented for instances of a class
The arguments after the class are one or more interfaces or
interface specifications (IDeclaration objects).
The interfaces given (including the interfaces in the
specifications) are added to any interfaces previously
declared.
...
|
|
classImplementsOnly
-
- Type:
-
str
- Value:
'''Declare the only interfaces implemented by instances of a class
The arguments after the class are one or more interfaces or
interface specifications (IDeclaration objects).
The interfaces given (including the interfaces in the
specifications) replace any previous declarations.
...
|
|
classProvides
-
- Type:
-
str
- Value:
"""Declare interfaces provided directly by a class
This function is called in a class definition.
The arguments are one or more interfaces or interface
specifications (IDeclaration objects).
The given interfaces (including the interfaces in the
...
|
|
Declaration
-
- Type:
-
str
- Value:
'''Create an interface specification
The arguments are one or more interfaces or interface
specifications (IDeclaration objects).
A new interface specification (IDeclaration) with
the given interfaces is returned.
'''
|
|
directlyProvidedBy
-
- Type:
-
str
- Value:
'''Return the interfaces directly provided by the given object
The value returned is an IDeclaration.
'''
|
|
directlyProvides
-
- Type:
-
str
- Value:
"""Declare interfaces declared directly for an object
The arguments after the object are one or more interfaces or
interface specifications (IDeclaration objects).
The interfaces given (including the interfaces in the
specifications) replace interfaces previously
declared for the object.
...
|
|
implementer
-
- Type:
-
str
- Value:
'''Create a decorator for declaring interfaces implemented by a facory
A callable is returned that makes an implements declaration on
objects passed to it.
'''
|
|
implements
-
- Type:
-
str
- Value:
'''Declare interfaces implemented by instances of a class
This function is called in a class definition.
The arguments are one or more interfaces or interface
specifications (IDeclaration objects).
The interfaces given (including the interfaces in the
...
|
|
implementsOnly
-
- Type:
-
str
- Value:
'''Declare the only interfaces implemented by instances of a class
This function is called in a class definition.
The arguments are one or more interfaces or interface
specifications (IDeclaration objects).
Previous declarations including declarations for base classes
...
|
|
moduleProvides
-
- Type:
-
str
- Value:
"""Declare interfaces provided by a module
This function is used in a module definition.
The arguments are one or more interfaces or interface
specifications (IDeclaration objects).
The given interfaces (including the interfaces in the
...
|
|