Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
tom
2014-08-29 11:57:11 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c53fa0de8e07ba88400a5f57b48a4c90cdf82fef
c53fa0de
1 parent
8f458bcb
Fixed check-style nags.
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
4 additions
and
14 deletions
utils/misc/src/main/java/org/onlab/graph/BreadthFirstSearch.java
utils/misc/src/test/java/org/onlab/graph/DefaultMutablePathTest.java
utils/misc/src/test/java/org/onlab/graph/DefaultPathTest.java
utils/misc/src/test/java/org/onlab/graph/GraphTest.java
utils/misc/src/test/java/org/onlab/graph/HeapTest.java
utils/misc/src/test/java/org/onlab/graph/TestVertex.java
utils/misc/src/main/java/org/onlab/graph/BreadthFirstSearch.java
View file @
c53fa0d
...
...
@@ -21,7 +21,8 @@ public class BreadthFirstSearch<V extends Vertex, E extends Edge<V>>
result
.
costs
.
put
(
src
,
0.0
);
frontier
.
add
(
src
);
search:
while
(!
frontier
.
isEmpty
())
{
search:
while
(!
frontier
.
isEmpty
())
{
// Prepare the next frontier.
Set
<
V
>
next
=
new
HashSet
<>();
...
...
@@ -38,8 +39,9 @@ public class BreadthFirstSearch<V extends Vertex, E extends Edge<V>>
cost
+
(
ew
==
null
?
1.0
:
ew
.
weight
(
edge
)),
true
);
// If we have reached our intended destination, bail.
if
(
nextVertex
.
equals
(
dst
))
if
(
nextVertex
.
equals
(
dst
))
{
break
search
;
}
next
.
add
(
nextVertex
);
}
}
...
...
utils/misc/src/test/java/org/onlab/graph/DefaultMutablePathTest.java
View file @
c53fa0d
package
org
.
onlab
.
graph
;
import
com.google.common.collect.ImmutableList
;
import
com.google.common.testing.EqualsTester
;
import
org.junit.Test
;
import
java.util.Iterator
;
import
java.util.List
;
import
static
com
.
google
.
common
.
collect
.
ImmutableList
.
of
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNull
;
...
...
utils/misc/src/test/java/org/onlab/graph/DefaultPathTest.java
View file @
c53fa0d
package
org
.
onlab
.
graph
;
import
com.google.common.collect.ImmutableList
;
import
com.google.common.testing.EqualsTester
;
import
org.junit.Test
;
...
...
@@ -8,7 +7,6 @@ import java.util.List;
import
static
com
.
google
.
common
.
collect
.
ImmutableList
.
of
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNull
;
/**
* Test of the default path.
...
...
utils/misc/src/test/java/org/onlab/graph/GraphTest.java
View file @
c53fa0d
package
org
.
onlab
.
graph
;
import
com.google.common.collect.ImmutableSet
;
import
java.util.Set
;
import
static
com
.
google
.
common
.
collect
.
ImmutableSet
.
of
;
...
...
utils/misc/src/test/java/org/onlab/graph/HeapTest.java
View file @
c53fa0d
package
org
.
onlab
.
graph
;
import
com.google.common.collect.ImmutableList
;
import
com.google.common.collect.Ordering
;
import
com.google.common.testing.EqualsTester
;
import
org.junit.Test
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Iterator
;
import
static
com
.
google
.
common
.
collect
.
ImmutableList
.
of
;
import
static
org
.
junit
.
Assert
.*;
...
...
utils/misc/src/test/java/org/onlab/graph/TestVertex.java
View file @
c53fa0d
...
...
@@ -2,8 +2,6 @@ package org.onlab.graph;
import
java.util.Objects
;
import
static
com
.
google
.
common
.
base
.
Objects
.
toStringHelper
;
/**
* Test vertex.
*/
...
...
Please
register
or
login
to post a comment