Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
droplet-sequence-generator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pedatestcontrib
droplet-sequence-generator
Commits
b04668f6
Commit
b04668f6
authored
8 years ago
by
Peter Wagenhuber
Browse files
Options
Downloads
Patches
Plain Diff
path.java weggeschmissen und stattdessen eine list<channel> genommen
parent
3ed02429
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
build/dsgen.jar
+0
-0
0 additions, 0 deletions
build/dsgen.jar
build/nloc/Nloc.class
+0
-0
0 additions, 0 deletions
build/nloc/Nloc.class
src/Nloc.java
+10
-9
10 additions, 9 deletions
src/Nloc.java
src/Path.java
+0
-28
0 additions, 28 deletions
src/Path.java
with
10 additions
and
37 deletions
build/dsgen.jar
+
0
−
0
View file @
b04668f6
No preview for this file type
This diff is collapsed.
Click to expand it.
build/nloc/Nloc.class
+
0
−
0
View file @
b04668f6
No preview for this file type
This diff is collapsed.
Click to expand it.
src/Nloc.java
+
10
−
9
View file @
b04668f6
...
...
@@ -46,34 +46,35 @@ public class Nloc {
chan9
.
addChild
(
chan10
);
chan10
.
addChild
(
s0
);
List
<
Path
>
pathlist
=
getAllPaths
(
p0
,
new
Path
());
//
print
All
Paths(p
0,new Path(), pl
);
List
<
List
<
Channel
>
>
pathlist
=
getAllPaths
(
p0
,
new
ArrayList
<
Channel
>
());
printPaths
(
p
athlist
);
}
public
static
void
printPaths
(
List
<
Path
>
pathlist
)
{
public
static
void
printPaths
(
List
<
List
<
Channel
>
>
pathlist
)
{
System
.
out
.
println
(
"Number of paths found: "
+
pathlist
.
size
());
for
(
Path
p
:
pathlist
)
{
for
(
Channel
ch
:
p
.
getChanlist
()
)
{
for
(
List
<
Channel
>
p
:
pathlist
)
{
for
(
Channel
ch
:
p
)
{
System
.
out
.
print
(
"ID: "
+
ch
.
getID
()
+
" "
);
}
System
.
out
.
println
(
""
);
}
}
public
static
List
<
Path
>
getAllPaths
(
Channel
chan
,
Path
path
)
{
List
<
Path
>
pl
=
new
ArrayList
<
Path
>();
public
static
List
<
List
<
Channel
>
>
getAllPaths
(
Channel
chan
,
List
<
Channel
>
path
)
{
List
<
List
<
Channel
>
>
pl
=
new
ArrayList
<
List
<
Channel
>
>();
getAllPathsRecursive
(
chan
,
path
,
pl
);
return
pl
;
}
public
static
void
getAllPathsRecursive
(
Channel
chan
,
Path
path
,
List
<
Path
>
pathlist
)
{
public
static
void
getAllPathsRecursive
(
Channel
chan
,
List
<
Channel
>
path
,
List
<
List
<
Channel
>>
pathlist
)
{
path
.
add
(
chan
);
if
(
chan
.
getChildren
().
size
()
==
0
)
{
pathlist
.
add
(
path
);
}
else
{
for
(
Channel
ch
:
chan
.
getChildren
())
{
getAllPathsRecursive
(
ch
,
new
Path
(
path
),
pathlist
);
getAllPathsRecursive
(
ch
,
new
ArrayList
<
Channel
>
(
path
),
pathlist
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/Path.java
deleted
100644 → 0
+
0
−
28
View file @
3ed02429
package
nloc
;
import
java.util.List
;
import
java.util.LinkedList
;
public
class
Path
{
private
List
<
Channel
>
path
;
public
Path
(
List
<
Channel
>
path
)
{
this
.
path
=
path
;
}
public
Path
(
Path
p
)
{
this
.
path
=
new
LinkedList
<
Channel
>(
p
.
getChanlist
());
}
public
Path
()
{
this
.
path
=
new
LinkedList
<
Channel
>();
}
public
void
add
(
Channel
chan
)
{
path
.
add
(
chan
);
}
public
List
<
Channel
>
getChanlist
()
{
return
path
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment