Class ConflictCollection

    • Constructor Detail

    • Method Detail

      • addConflictListener

        public void addConflictListener​(IConflictListener listener)
        Adds the specified conflict listener, if not already present.
        Parameters:
        listener - The conflict listener to add
      • addConflict

        protected void addConflict​(Conflict<?> conflict)
        Adds a conflict to the collection
        Parameters:
        conflict - the conflict
        Throws:
        IllegalStateException - if this collection already includes a conflict for conflict.getMy()
      • add

        public void add​(Conflict<?> conflict)
        Adds a conflict to the collection of conflicts.
        Parameters:
        conflict - the conflict to add. Must not be null.
        Throws:
        IllegalArgumentException - if conflict is null
        IllegalStateException - if this collection already includes a conflict for conflict.getMy()
      • add

        public void add​(Collection<Conflict<?>> otherConflicts)
        Add the conflicts in otherConflicts to this collection of conflicts
        Parameters:
        otherConflicts - the collection of conflicts. Does nothing is conflicts is null.
      • remove

        public void remove​(Conflict<?> conflict)
        removes a conflict from this collection
        Parameters:
        conflict - the conflict
      • hasConflictForMy

        public boolean hasConflictForMy​(OsmPrimitive my)
        Replies true, if this collection includes a conflict for my.
        Parameters:
        my - my primitive
        Returns:
        true, if this collection includes a conflict for my; false, otherwise
      • hasConflict

        public boolean hasConflict​(Conflict<?> c)
        Replies true, if this collection includes a given conflict
        Parameters:
        c - the conflict
        Returns:
        true, if this collection includes the conflict; false, otherwise
      • hasConflictForTheir

        public boolean hasConflictForTheir​(OsmPrimitive their)
        Replies true, if this collection includes a conflict for their.
        Parameters:
        their - their primitive
        Returns:
        true, if this collection includes a conflict for their; false, otherwise
      • get

        public List<Conflict<?>> get()
        Replies the conflicts as list.
        Returns:
        the list of conflicts
      • size

        public int size()
        Replies the size of the collection
        Returns:
        the size of the collection
      • get

        public Conflict<?> get​(int idx)
        Replies the conflict at position idx
        Parameters:
        idx - the index
        Returns:
        the conflict at position idx
      • add

        public void add​(ConflictCollection other)
        Adds all conflicts from another collection.
        Parameters:
        other - The other collection of conflicts to add
      • getMyConflictParties

        public Set<OsmPrimitivegetMyConflictParties()
        Replies the set of OsmPrimitive which participate in the role of "my" in the conflicts managed by this collection.
        Returns:
        the set of OsmPrimitive which participate in the role of "my" in the conflicts managed by this collection.
      • getTheirConflictParties

        public Set<OsmPrimitivegetTheirConflictParties()
        Replies the set of OsmPrimitive which participate in the role of "their" in the conflicts managed by this collection.
        Returns:
        the set of OsmPrimitive which participate in the role of "their" in the conflicts managed by this collection.
      • isEmpty

        public boolean isEmpty()
        Replies true if this collection is empty
        Returns:
        true, if this collection is empty; false, otherwise
      • getNumberOfNodeConflicts

        public final long getNumberOfNodeConflicts()
        Returns the number of conflicts involving nodes.
        Returns:
        The number of conflicts involving nodes.
        Since:
        17524
      • getNumberOfWayConflicts

        public final long getNumberOfWayConflicts()
        Returns the number of conflicts involving nodes.
        Returns:
        The number of conflicts involving nodes.
        Since:
        17524
      • getNumberOfRelationConflicts

        public final long getNumberOfRelationConflicts()
        Returns the number of conflicts involving nodes.
        Returns:
        The number of conflicts involving nodes.
        Since:
        17524