Class AbstractMatchedObjectOrderer<U>

java.lang.Object
com._1c.g5.v8.dt.compare.order.AbstractMatchedObjectOrderer<U>
Type Parameters:
U - the type of matched objects
Direct Known Subclasses:
ComparisonTextRegionWrapperOrderer, MatchedBslModuleSectionOrderer, MatchedEmfObjectOrderer, MatchedMdObjectOrderer

public abstract class AbstractMatchedObjectOrderer<U> extends Object
An abstract orderer of matched objects.
  • Constructor Details

    • AbstractMatchedObjectOrderer

      protected AbstractMatchedObjectOrderer(Collection<U> matchedObjects, boolean isThreeWay)
      Constructs an orderer.
      Parameters:
      matchedObjects - the matched objects to work with, cannot be null
      isThreeWay - tells whether the comparison session is three-way
  • Method Details

    • getMatchedObjects

      public Collection<U> getMatchedObjects()
      Returns the matched objects this orderer is working with.
      Returns:
      the matched objects
    • getOrdered

      public List<U> getOrdered(ComparisonSide orderSide)
      Returns a list of matched objects ordered according to the specified side.
      Parameters:
      orderSide - the side that will be used to determine the resulting order, must be either MAIN or OTHER, cannot be null
      Returns:
      the list of matched ordered objects, never null
    • getWithChangedOrder

      public List<U> getWithChangedOrder(ComparisonSide side1, ComparisonSide side2)
      Returns a list of matched objects whose order was changed between the specified sides.
      Parameters:
      side1 -
      side2 -
      Returns:
    • isPresent

      protected abstract boolean isPresent(U object, ComparisonSide side)
      Checks whether a source object is present on the specified side of the matched object.
      Parameters:
      object - the matched object
      side - the source side to check
      Returns:
      true when the source object is present
    • getOrder

      protected abstract int getOrder(U object, ComparisonSide side)
      Returns the original order index of the source object on the specified side.
      Parameters:
      object - the matched object
      side - the side of the source object
      Returns:
      order index of the source object (irrelevant if the object is not present)