Module org.jgrapht.core
Package org.jgrapht.alg.util.extension
Class ExtensionManager<T,B extends Extension>
java.lang.Object
org.jgrapht.alg.util.extension.ExtensionManager<T,B>
- Type Parameters:
T
- class-type to be extended (class-type of original)B
- class-type of extension
Convenience class to manage extensions/encapsulations. This class creates and manages object
extensions and encapsulations. An object, from here on denoted as 'original', can be encapsulated
in or extended by another object. An example would be the relation between an edge (original) and
an annotated edge. The annotated edge encapsulates/extends an edge, thereby augmenting it with
additional data. In symbolic form, if b is the original class, then a(b) would be its extension.
This concept is similar to java's extension where one class is derived from (extends) another
class (original).
-
Constructor Summary
ConstructorDescriptionExtensionManager
(ExtensionFactory<B> factory) Create a new extension manager. -
Method Summary
Modifier and TypeMethodDescriptionCreates and returns an extension object.getExtension
(T t) Creates a new singleton extension object for original t if no such object exists, returns the old one otherwise.
-
Constructor Details
-
ExtensionManager
Create a new extension manager.- Parameters:
factory
- the extension factory to use
-
-
Method Details
-
createExtension
Creates and returns an extension object.- Returns:
- Extension object
-
getExtension
Creates a new singleton extension object for original t if no such object exists, returns the old one otherwise.- Parameters:
t
- the original object- Returns:
- the extension object
-