Skip to content
Snippets Groups Projects
Commit e943342b authored by Anders Austlid's avatar Anders Austlid
Browse files

Changes to interest point system

parent c8480d6f
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment