public class ThreeWayResourceComparator extends Object implements IResourceVariantComparator
ThreeWaySynchronizer
to compare local resources to their resource variants. The local state
is determined using the local modification state and the remote state
is determined by comparing the base bytes to the remote bytes obtained
from the synchronizer.Constructor and Description |
---|
ThreeWayResourceComparator(ThreeWaySynchronizer synchronizer)
Create a three-way resource comparator that uses the
ThreeWaySynchronizer
to compare a local resource to a resource variant. |
Modifier and Type | Method and Description |
---|---|
boolean |
compare(IResource local,
IResourceVariant remote)
Returns
true if the local resource
matches the remote resource based on this criteria and false
otherwise. |
boolean |
compare(IResourceVariant base,
IResourceVariant remote)
Returns
true if the base resource
matches the remote resource based on this criteria and false
otherwise. |
boolean |
isThreeWay()
Answers
true if the base tree is maintained by this comparator's
subscriber. |
public ThreeWayResourceComparator(ThreeWaySynchronizer synchronizer)
ThreeWaySynchronizer
to compare a local resource to a resource variant.synchronizer
- public boolean compare(IResource local, IResourceVariant remote)
IResourceVariantComparator
true
if the local resource
matches the remote resource based on this criteria and false
otherwise. Comparing should be fast and based on cached information.compare
in interface IResourceVariantComparator
local
- the local resource to be comparedremote
- the remote resources to be comparedtrue
if local and remote are equal based on this criteria and false
otherwise.public boolean compare(IResourceVariant base, IResourceVariant remote)
IResourceVariantComparator
true
if the base resource
matches the remote resource based on this criteria and false
otherwise. Comparing should be fast and based on cached information.compare
in interface IResourceVariantComparator
base
- the base resource to be comparedremote
- the remote resources to be comparedtrue
if base and remote are equal based on this criteria and false
otherwise.public boolean isThreeWay()
IResourceVariantComparator
true
if the base tree is maintained by this comparator's
subscriber. If the base tree is not considered than the subscriber can
be considered as not supported three-way comparisons. Instead
comparisons are made between the local and remote only without
consideration for the base.isThreeWay
in interface IResourceVariantComparator
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.