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 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 Details

    • ExtensionManager

      public ExtensionManager(ExtensionFactory<B> factory)
      Create a new extension manager.
      Parameters:
      factory - the extension factory to use
  • Method Details

    • createExtension

      public B createExtension()
      Creates and returns an extension object.
      Returns:
      Extension object
    • getExtension

      public B getExtension(T t)
      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