Ignore:
Timestamp:
2009-12-05T18:23:03+01:00 (14 years ago)
Author:
jttt
Message:

Encalupse OsmPrimitive.incomplete

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r2555 r2578  
    116116    public ArrayList<Pair<Node,Node>> getNodePairs(boolean sort) {
    117117        ArrayList<Pair<Node,Node>> chunkSet = new ArrayList<Pair<Node,Node>>();
    118         if (incomplete) return chunkSet;
     118        if (isIncomplete()) return chunkSet;
    119119        Node lastN = null;
    120120        for (Node n : this.nodes) {
     
    219219
    220220    @Override public String toString() {
    221         String nodesDesc = incomplete?"(incomplete)":"nodes=" + Arrays.toString(nodes);
     221        String nodesDesc = isIncomplete()?"(incomplete)":"nodes=" + Arrays.toString(nodes);
    222222        return "{Way id=" + getUniqueId() + " version=" + getVersion()+ " " + getFlagsAsString()  + " " + nodesDesc + "}";
    223223    }
     
    245245
    246246    public void removeNode(Node n) {
    247         if (incomplete) return;
     247        if (isIncomplete()) return;
    248248        boolean closed = (lastNode() == n && firstNode() == n);
    249249        int i;
     
    262262
    263263    public void removeNodes(Collection<? extends OsmPrimitive> selection) {
    264         if (incomplete) return;
     264        if (isIncomplete()) return;
    265265        for(OsmPrimitive p : selection) {
    266266            if (p instanceof Node) {
     
    279279    public void addNode(Node n) throws IllegalStateException {
    280280        if (n==null) return;
    281         if (incomplete)
     281        if (isIncomplete())
    282282            throw new IllegalStateException(tr("Cannot add node {0} to incomplete way {1}.", n.getId(), getId()));
    283283        clearCached();
     
    301301    public void addNode(int offs, Node n) throws IllegalStateException, IndexOutOfBoundsException {
    302302        if (n==null) return;
    303         if (incomplete)
     303        if (isIncomplete())
    304304            throw new IllegalStateException(tr("Cannot add node {0} to incomplete way {1}.", n.getId(), getId()));
    305305        clearCached();
     
    327327
    328328    public boolean isClosed() {
    329         if (incomplete) return false;
     329        if (isIncomplete()) return false;
    330330        return nodes.length >= 3 && lastNode() == firstNode();
    331331    }
    332332
    333333    public Node lastNode() {
    334         if (incomplete || nodes.length == 0) return null;
     334        if (isIncomplete() || nodes.length == 0) return null;
    335335        return nodes[nodes.length-1];
    336336    }
    337337
    338338    public Node firstNode() {
    339         if (incomplete || nodes.length == 0) return null;
     339        if (isIncomplete() || nodes.length == 0) return null;
    340340        return nodes[0];
    341341    }
    342342
    343343    public boolean isFirstLastNode(Node n) {
    344         if (incomplete || nodes.length == 0) return false;
     344        if (isIncomplete() || nodes.length == 0) return false;
    345345        return n == firstNode() || n == lastNode();
    346346    }
Note: See TracChangeset for help on using the changeset viewer.