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:
        java.lang.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:
        java.lang.IllegalArgumentException - if conflict is null
        java.lang.IllegalStateException - if this collection already includes a conflict for conflict.getMy()
      • add

        public void add​(java.util.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 java.util.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
      • iterator

        public java.util.Iterator<Conflict<?>> iterator()
        Replies the iterator for this collection.
        Specified by:
        iterator in interface java.lang.Iterable<Conflict<? extends OsmPrimitive>>
        Returns:
        the iterator
      • add

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

        public java.util.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 java.util.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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getNodeConflicts

        public final java.util.Collection<Conflict<? extends OsmPrimitive>> getNodeConflicts()
        Returns the list of conflicts involving nodes.
        Returns:
        The list of conflicts involving nodes.
        Since:
        6555
      • getWayConflicts

        public final java.util.Collection<Conflict<? extends OsmPrimitive>> getWayConflicts()
        Returns the list of conflicts involving ways.
        Returns:
        The list of conflicts involving ways.
        Since:
        6555
      • getRelationConflicts

        public final java.util.Collection<Conflict<? extends OsmPrimitive>> getRelationConflicts()
        Returns the list of conflicts involving relations.
        Returns:
        The list of conflicts involving relations.
        Since:
        6555
      • 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object