Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ø
øving 9
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Awesome group
øving 9
Commits
e943342b
Commit
e943342b
authored
2 years ago
by
Anders Austlid
Browse files
Options
Downloads
Patches
Plain Diff
Changes to interest point system
parent
c8480d6f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Task9.java
+20
-10
20 additions, 10 deletions
src/Task9.java
with
20 additions
and
10 deletions
src/Task9.java
+
20
−
10
View file @
e943342b
...
...
@@ -8,14 +8,13 @@ public class Task9 {
public
static
void
main
(
String
[]
args
)
{
Graph
g
=
new
Graph
(
"noderIceland.txt"
);
g
.
loadEdges
(
"kanterIceland.txt"
);
g
.
printEdges
();
}
}
class
Node
{
private
final
int
number
;
private
final
double
latitude
;
private
final
double
longitude
;
private
String
[]
typeArray
;
private
short
[]
typeArray
;
private
String
name
;
private
boolean
isLandmark
;
...
...
@@ -41,7 +40,7 @@ class Node{
return
longitude
;
}
public
String
[]
getTypeArray
()
{
public
short
[]
getTypeArray
()
{
return
typeArray
;
}
...
...
@@ -53,24 +52,27 @@ class Node{
this
.
name
=
name
;
}
public
void
setType
(
String
type
){
public
void
setType
(
short
type
){
if
(
typeArray
==
null
){
this
.
typeArray
=
new
String
[
6
];
this
.
typeArray
=
new
short
[
6
];
}
this
.
setInFreeSpace
(
type
,
this
.
getTypeArray
()
);
this
.
setInFreeSpace
(
type
);
}
private
void
setInFreeSpace
(
String
type
,
String
[]
typeArray
){
private
void
setInFreeSpace
(
short
type
){
for
(
int
i
=
0
;
i
<
typeArray
.
length
;
i
++){
if
(
typeArray
[
i
]==
null
){
if
(
typeArray
[
i
]==
0
){
typeArray
[
i
]=
type
;
i
=
typeArray
.
length
;
}
}
}
public
boolean
isTypeOf
(
String
typeName
){
return
Arrays
.
stream
(
typeArray
).
anyMatch
(
t
->
t
.
equalsIgnoreCase
(
typeName
));
public
boolean
isTypeOf
(
short
type
){
for
(
var
value
:
typeArray
)
{
if
(
value
==
type
)
return
true
;
}
return
false
;
}
@Override
...
...
@@ -149,6 +151,14 @@ class Graph{
}
}*/
public
void
loadInterestPoints
(
String
inFile
)
{
List
<
String
>
data
=
Utils
.
readFile
(
inFile
);
for
(
int
i
=
0
;
i
<
data
.
size
();
++
i
)
{
String
[]
splitText
=
Utils
.
dividedText
(
data
.
get
(
i
),
3
);
Node
node
=
}
}
/*private void setTypes(int nodeNumber,int typeValue, String name){
Node node = this.getNode(nodeNumber);
...
...
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