Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
API
Commits
33cd728a
Commit
33cd728a
authored
Aug 24, 2016
by
Roland Kluge
Browse files
Add shortcut in BasicGraph#getEdge
parent
fb050fbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tudarmstadt/maki/simonstrator/api/common/graph/BasicGraph.java
View file @
33cd728a
...
@@ -381,7 +381,9 @@ public class BasicGraph implements Graph {
...
@@ -381,7 +381,9 @@ public class BasicGraph implements Graph {
if
(!
this
.
containsNode
(
to
))
if
(!
this
.
containsNode
(
to
))
return
null
;
return
null
;
// TODO@rkluge: May be a performance issue.
if
(!
this
.
containsEdge
(
from
,
to
))
return
null
;
final
Set
<
IEdge
>
outgoingEdgesOfFrom
=
this
.
outgoingAdjacencyList
.
get
(
from
);
final
Set
<
IEdge
>
outgoingEdgesOfFrom
=
this
.
outgoingAdjacencyList
.
get
(
from
);
for
(
final
IEdge
outgoingEdgeOfFrom
:
outgoingEdgesOfFrom
)
{
for
(
final
IEdge
outgoingEdgeOfFrom
:
outgoingEdgesOfFrom
)
{
if
(
outgoingEdgeOfFrom
.
toId
().
equals
(
to
))
{
if
(
outgoingEdgeOfFrom
.
toId
().
equals
(
to
))
{
...
@@ -402,6 +404,9 @@ public class BasicGraph implements Graph {
...
@@ -402,6 +404,9 @@ public class BasicGraph implements Graph {
if
(!
this
.
containsNode
(
to
))
if
(!
this
.
containsNode
(
to
))
return
resultSet
;
return
resultSet
;
if
(!
this
.
containsEdge
(
from
,
to
))
return
resultSet
;
final
Set
<
IEdge
>
outgoingEdgesOfFrom
=
this
.
outgoingAdjacencyList
.
get
(
from
);
final
Set
<
IEdge
>
outgoingEdgesOfFrom
=
this
.
outgoingAdjacencyList
.
get
(
from
);
for
(
final
IEdge
outgoingEdgeOfFrom
:
outgoingEdgesOfFrom
)
{
for
(
final
IEdge
outgoingEdgeOfFrom
:
outgoingEdgesOfFrom
)
{
if
(
outgoingEdgeOfFrom
.
toId
().
equals
(
to
))
{
if
(
outgoingEdgeOfFrom
.
toId
().
equals
(
to
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment