forked from jgrapht/jgrapht
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request jgrapht#288 from d-michail/ext-providers-interface…
…-refactoring Unified name providers for exporters using a common interface
- Loading branch information
Showing
24 changed files
with
469 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
jgrapht-ext/src/main/java/org/jgrapht/ext/ComponentNameProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* (C) Copyright 2016-2016, by Dimitrios Michail and Contributors. | ||
* | ||
* JGraphT : a free Java graph-theory library | ||
* | ||
* This program and the accompanying materials are dual-licensed under | ||
* either | ||
* | ||
* (a) the terms of the GNU Lesser General Public License version 2.1 | ||
* as published by the Free Software Foundation, or (at your option) any | ||
* later version. | ||
* | ||
* or (per the licensee's choosing) | ||
* | ||
* (b) the terms of the Eclipse Public License v1.0 as published by | ||
* the Eclipse Foundation. | ||
*/ | ||
package org.jgrapht.ext; | ||
|
||
/** | ||
* Provides a name for a component. | ||
* | ||
* @param <T> the type of the component | ||
*/ | ||
public interface ComponentNameProvider<T> | ||
{ | ||
|
||
/** | ||
* Returns a unique name. This is useful when exporting a graph, as it ensures that all | ||
* vertices/edges are assigned simple, consistent names. | ||
* | ||
* @param component the component to be named | ||
* @return the name of the component | ||
*/ | ||
String getName(T component); | ||
|
||
} | ||
|
||
// End ComponentNameProvider.java |
39 changes: 39 additions & 0 deletions
39
jgrapht-ext/src/main/java/org/jgrapht/ext/ComponentUpdater.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* (C) Copyright 2015-2016, by Wil Selwood and Contributors. | ||
* | ||
* JGraphT : a free Java graph-theory library | ||
* | ||
* This program and the accompanying materials are dual-licensed under | ||
* either | ||
* | ||
* (a) the terms of the GNU Lesser General Public License version 2.1 | ||
* as published by the Free Software Foundation, or (at your option) any | ||
* later version. | ||
* | ||
* or (per the licensee's choosing) | ||
* | ||
* (b) the terms of the Eclipse Public License v1.0 as published by | ||
* the Eclipse Foundation. | ||
*/ | ||
package org.jgrapht.ext; | ||
|
||
import java.util.*; | ||
|
||
/** | ||
* Type to handle updates to a component when an import gets more information about it after it has | ||
* been created. | ||
* | ||
* @param <T> the component type | ||
*/ | ||
public interface ComponentUpdater<T> | ||
{ | ||
/** | ||
* Update component with the extra attributes. | ||
* | ||
* @param component to update | ||
* @param attributes to add to the component | ||
*/ | ||
void update(T component, Map<String, String> attributes); | ||
} | ||
|
||
// End ComponentUpdater.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.