Package com._1c.g5.v8.dt.compare.model
Class ComparedObjects<T>
java.lang.Object
com._1c.g5.v8.dt.compare.model.ComparedObjects<T>
- All Implemented Interfaces:
IComparedObjects<T>
,Cloneable
- Direct Known Subclasses:
AbstractComparedEmfObjects
,ComparedBslModuleSectionDescriptions
,ComparedSymlinks
,ComparedUniqueSymlinks
A standard implementation of a triple of objects being compared.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty provider.ComparedObjects
(T main, T other, T commonAncestor) Constructs a triple of objects being compared. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones the compared object containerReturns the common ancestor object.Returns a compared object on the specified side.Returns the main object.Returns MAIN or OTHER side if the object presents only on the one of them.int
getOrder
(ComparisonSide side) Returns the order index of the source object from the specified side.Returns the other object.getPath
(ComparisonSide side) Returns path to the compared object.void
setComparedObject
(ComparisonSide side, T object) Sets the compared object for the specified side.void
setOrder
(ComparisonSide side, int order) Sets the order index of a source object on the specified side.void
setPath
(ComparisonSide side, ComparedObjectPath path) Sets the path to the compared object.
-
Constructor Details
-
ComparedObjects
public ComparedObjects()Constructs an empty provider. -
ComparedObjects
Constructs a triple of objects being compared.- Parameters:
main
- the main object, may benull
other
- the other object, may benull
commonAncestor
- the common ancestor object, may benull
-
-
Method Details
-
getMainObject
Description copied from interface:IComparedObjects
Returns the main object.- Specified by:
getMainObject
in interfaceIComparedObjects<T>
- Returns:
- the main object or
null
-
getOtherObject
Description copied from interface:IComparedObjects
Returns the other object.- Specified by:
getOtherObject
in interfaceIComparedObjects<T>
- Returns:
- the other object or
null
-
getCommonAncestorObject
Description copied from interface:IComparedObjects
Returns the common ancestor object.- Specified by:
getCommonAncestorObject
in interfaceIComparedObjects<T>
- Returns:
- the common ancestor object or
null
-
getComparedObject
Description copied from interface:IComparedObjects
Returns a compared object on the specified side.- Specified by:
getComparedObject
in interfaceIComparedObjects<T>
- Parameters:
side
- the side to get the object for, notnull
- Returns:
- the object on the side, may be
null
-
setComparedObject
Sets the compared object for the specified side.- Specified by:
setComparedObject
in interfaceIComparedObjects<T>
- Parameters:
side
- the side to set the compared object forobject
- the compared object to set
-
getObjectSide
Description copied from interface:IComparedObjects
Returns MAIN or OTHER side if the object presents only on the one of them. Fully ignores object's presence on COMMON_ANCESTOR side.- Specified by:
getObjectSide
in interfaceIComparedObjects<T>
- Returns:
- the MAIN or OTHER side or
null
if it presents on both of them or doesn't present on any of them
-
getOrder
Description copied from interface:IComparedObjects
Returns the order index of the source object from the specified side.- Specified by:
getOrder
in interfaceIComparedObjects<T>
- Parameters:
side
- the side of the object, notnull
- Returns:
- the order index or -1 if no order stored
-
setOrder
Description copied from interface:IComparedObjects
Sets the order index of a source object on the specified side.- Specified by:
setOrder
in interfaceIComparedObjects<T>
- Parameters:
side
- the side of the source object, notnull
order
- the source object order index
-
getPath
Description copied from interface:IComparedObjects
Returns path to the compared object.- Specified by:
getPath
in interfaceIComparedObjects<T>
- Parameters:
side
- the comparison side to get the path for, notnull
- Returns:
- the path to the compared object from the closest top parent, never
null
-
setPath
Description copied from interface:IComparedObjects
Sets the path to the compared object.- Specified by:
setPath
in interfaceIComparedObjects<T>
- Parameters:
side
- the comparison side to set the path for, cannotnull
path
- the path to set, cannot benull
-
clone
Description copied from interface:IComparedObjects
Clones the compared object container- Specified by:
clone
in interfaceIComparedObjects<T>
- Overrides:
clone
in classObject
- Returns:
- A new instance of the container of the same class. Never
null
. Internal data should be eligible for safe changes by the caller side - Throws:
CloneNotSupportedException
- In case if cloning isn't supported
-