Package com._1c.g5.v8.dt.compare.order
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:
MatchedEmfObjectOrderer
,MatchedMdObjectOrderer
public abstract class AbstractMatchedObjectOrderer<U> extends Object
An abstract orderer of matched objects.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMatchedObjectOrderer(Collection<U> matchedObjects, boolean isThreeWay)
Constructs an orderer.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Collection<U>
getMatchedObjects()
Returns the matched objects this orderer is working with.protected abstract int
getOrder(U object, ComparisonSide side)
Returns the original order index of the source object on the specified side.List<U>
getOrdered(ComparisonSide orderSide)
Returns a list of matched objects ordered according to the specified side.List<U>
getWithChangedOrder(ComparisonSide side1, ComparisonSide side2)
Returns a list of matched objects whose order was changed between the specified sides.protected abstract boolean
isPresent(U object, ComparisonSide side)
Checks whether a source object is present on the specified side of the matched object.
-
-
-
Constructor Detail
-
AbstractMatchedObjectOrderer
protected AbstractMatchedObjectOrderer(Collection<U> matchedObjects, boolean isThreeWay)
Constructs an orderer.- Parameters:
matchedObjects
- the matched objects to work with, cannot benull
isThreeWay
- tells whether the comparison session is three-way
-
-
Method Detail
-
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 benull
- 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 objectside
- 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 objectside
- the side of the source object- Returns:
- order index of the source object (irrelevant if the object is not present)
-
-