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
public class ExtensionManager<T,B extends Extension> extends java.lang.Object
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
Constructors Constructor Description ExtensionManager(ExtensionFactory<B> factory)
Create a new extension manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description B
createExtension()
Creates and returns an extension object.B
getExtension(T t)
Creates a new singleton extension object for original t if no such object exists, returns the old one otherwise.
-
-
-
Constructor Detail
-
ExtensionManager
public ExtensionManager(ExtensionFactory<B> factory)
Create a new extension manager.- Parameters:
factory
- the extension factory to use
-
-
Method Detail
-
createExtension
public B createExtension()
Creates and returns an extension object.- Returns:
- Extension object
-
-