Changeset 32358 in osm


Ignore:
Timestamp:
2016-06-22T01:44:57+02:00 (8 years ago)
Author:
donvip
Message:

findbugs

Location:
applications/editors/josm/plugins/OSMRecPlugin
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/OSMRecPlugin/src/org/openstreetmap/josm/plugins/container/OSMWay.java

    r31106 r32358  
    11package org.openstreetmap.josm.plugins.container;
    22
    3 import com.vividsolutions.jts.geom.Coordinate;
    4 import com.vividsolutions.jts.geom.Geometry;
    5 import de.bwaldvogel.liblinear.FeatureNode;
    63import java.io.Serializable;
    74import java.util.ArrayList;
     
    129import java.util.TreeMap;
    1310
     11import com.vividsolutions.jts.geom.Coordinate;
     12import com.vividsolutions.jts.geom.Geometry;
     13
     14import de.bwaldvogel.liblinear.FeatureNode;
     15
    1416/**
    1517 * Class containing information about the OSM ways.
    16  * 
     18 *
    1719 * @author imis-nkarag
    1820 */
     21public class OSMWay implements Serializable{
    1922
    20 public class OSMWay implements Serializable{
    21    
    22     private String id;
     23    private String id;
    2324    private String user;
    2425    private int classID;
    25     private Set<Integer> classIDs;   
     26    private Set<Integer> classIDs;
    2627    private final List<String> nodeReferences = new ArrayList<>(); //node references  //made final
    2728    private final List<Geometry> nodeGeometries = new ArrayList<>(); //nodeGeometries   //made final
    28     private Coordinate[] coordinateList;   
    29     private Map<String, String> tags = new HashMap<>();     
     29    private Coordinate[] coordinateList;
     30    private Map<String, String> tags = new HashMap<>();
    3031    private Geometry geometry;
    31     private TreeMap<Integer,Double> indexVector = new TreeMap<>();   
     32    private TreeMap<Integer,Double> indexVector = new TreeMap<>();
    3233    private ArrayList<FeatureNode> featureNodeList = new ArrayList<>();
    33     //private Map<String, String> tags; 
    34    
    35     //way attributes getters 
     34    //private Map<String, String> tags;
     35
     36    //way attributes getters
    3637    public String getID(){
    3738        return id;
    38     } 
    39    
     39    }
     40
    4041    public String getUser(){
    4142        return user;
    4243    }
    43    
     44
    4445    public List<Geometry> getNodeGeometries(){
    4546        return nodeGeometries;
    4647    }
    47    
    48     public Coordinate[] getCoordinateList(){       
    49         coordinateList =  (Coordinate[]) nodeGeometries.toArray();
     48
     49    public Coordinate[] getCoordinateList(){
     50        coordinateList = nodeGeometries.toArray(new Coordinate[0]);
    5051        return coordinateList;
    5152    }
    52    
     53
    5354    public Geometry getGeometry(){
    5455        return geometry;
    55     }   
    56    
     56    }
     57
    5758    public List<String> getNodeReferences(){
    5859        return nodeReferences;
    5960    }
    60    
     61
    6162    public int getNumberOfNodes(){
    6263        return nodeReferences.size();
    6364    }
    64    
     65
    6566    public Map<String, String> getTagKeyValue(){
    6667        return tags;
    6768    }
    68    
     69
    6970    public int getClassID(){
    7071        return classID;
    7172    }
    72    
     73
    7374    public Set<Integer> getClassIDs(){
    7475        return classIDs;
    7576    }
    76      
     77
    7778    public TreeMap<Integer, Double> getIndexVector(){
    7879        return indexVector;
    7980    }
    80    
     81
    8182    public void setIndexVector(TreeMap<Integer, Double> indexVector){
    8283        this.indexVector = indexVector;
    8384    }
    84    
     85
    8586    //way attributes setters
    8687    public void setID(String id){
    8788        this.id = id;
    8889    }
    89    
     90
    9091    public void setUser(String user){
    9192        this.user = user;
    9293    }
    93    
     94
    9495    public void setTagKeyValue(String tagKey, String tagValue){
    9596        this.tags.put(tagKey, tagValue);
    9697    }
    97    
     98
    9899    public void addNodeReference(String nodeReference){
    99100        nodeReferences.add(nodeReference);
    100101    }
    101    
     102
    102103    public void addNodeGeometry(Geometry geometry){
    103104        nodeGeometries.add(geometry);
    104105    }
    105    
    106     public void setGeometry(Geometry geometry){       
     106
     107    public void setGeometry(Geometry geometry){
    107108        this.geometry = geometry;
    108     } 
    109    
     109    }
     110
    110111    public void setClassID(int classID){
    111112        this.classID = classID;
     
    114115    public void setClassIDs(Set<Integer> classIDs){
    115116        this.classIDs = classIDs;
    116     } 
    117    
     117    }
     118
    118119    public void setFeature(FeatureNode featureNode){
    119120        this.featureNodeList.add(featureNode);
    120121    }
    121    
     122
    122123    public List<FeatureNode> getFeatureNodeList(){
    123124        return featureNodeList;
    124125    }
    125    
     126
    126127    public void setAllTags(Map<String, String> selectedTags){
    127128        tags.putAll(selectedTags);
Note: See TracChangeset for help on using the changeset viewer.