Package org.tmatesoft.svn.core
Class SVNMergeRange
java.lang.Object
org.tmatesoft.svn.core.SVNMergeRange
- All Implemented Interfaces:
Comparable
The SVNMergeRange class represents a range of merged revisions.
- Since:
- 1.2
- Version:
- 1.3
- Author:
- TMate Software Ltd.
-
Constructor Summary
ConstructorsConstructorDescriptionSVNMergeRange
(long startRevision, long endRevision, boolean isInheritable) Constructs a newSVNMergeRange
object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canCombine
(SVNMergeRange range, boolean considerInheritance) Tells whether this range can me combined with the givenrange
depending on inheritance or not.combine
(SVNMergeRange range, boolean considerInheritance) Combines this merge range and the givenrange
into a single one.int
Compares this object to another one.boolean
contains
(SVNMergeRange range, boolean considerInheritance) Says whether this range contains the specifiedrange
depending on inheritance or not.dup()
Makes an exact copy of this object.boolean
Says if this object is equal toobj
or not.long
Returns the end revision of this merge range.long
Returns the start revision of this merge range.boolean
intersects
(SVNMergeRange range, boolean considerInheritance) Says whether this range intersects the specifiedrange
depending on inheritance or not.boolean
Tells whether this merge range should be inherited by treewise descendants of the path to which the range applies.void
setEndRevision
(long endRevision) Sets the end revision of this merge range.void
setInheritable
(boolean isInheritable) Sets whether this merge range is inheritable or not.void
setStartRevision
(long startRevision) Sets the start revision of this merge range.Swaps the start revision and the end revision of this merge range object.toString()
Return a string representation of this object.
-
Constructor Details
-
SVNMergeRange
public SVNMergeRange(long startRevision, long endRevision, boolean isInheritable) Constructs a newSVNMergeRange
object.- Parameters:
startRevision
- start revision of this merge rangeendRevision
- end revision of this merge rangeisInheritable
- whether this range is inheritable or not
-
-
Method Details
-
getEndRevision
public long getEndRevision()Returns the end revision of this merge range.- Returns:
- end revision
-
getStartRevision
public long getStartRevision()Returns the start revision of this merge range.- Returns:
- start revision
-
setEndRevision
public void setEndRevision(long endRevision) Sets the end revision of this merge range. This method is used bySVNKit
internals and is not intended for API users.- Parameters:
endRevision
- merge range end revision
-
setStartRevision
public void setStartRevision(long startRevision) Sets the start revision of this merge range. This method is used bySVNKit
internals and is not intended for API users.- Parameters:
startRevision
- merge range start revision
-
compareTo
Compares this object to another one. Note: merge rangeinheritance
is not taken into account when comparing twoSVNMergeRange
objects.- Specified by:
compareTo
in interfaceComparable
- Parameters:
o
- object to compare to- Returns:
0
ifo
is exactly this object oro.getStartRevision() == this.getStartRevision() && o.getEndRevision() == this.getEndRevision()
;-1
if eitherthis.getStartRevision() < o.getStartRevision()
orthis.getStartRevision() == o.getStartRevision() && this.getEndRevision() < o.getEndRevision()
;1
if eitherthis.getStartRevision() > o.getStartRevision()
orthis.getStartRevision() == o.getStartRevision() && this.getEndRevision() > o.getEndRevision()
-
equals
Says if this object is equal toobj
or not. Identical tothis.compareTo(obj) == 0
. -
combine
Combines this merge range and the givenrange
into a single one. Combining may only occur ifcanCombine(SVNMergeRange, boolean)
returns true for the specified parameters. Note: combining changes the state of this object.- Parameters:
range
- range to combine with this rangeconsiderInheritance
- whether inheritance information should be taken into account- Returns:
- if combining occurs, returns this object which is now a combination
of the two ranges; otherwise returns
range
-
canCombine
Tells whether this range can me combined with the givenrange
depending on inheritance or not. Combining may occur only when two ranges intersect each other what may be checked by the following case:range1.getStartRevision() <= range2.getEndRevision() && range2.getStartRevision() <= range1.getEndRevision()
. If this condition evaluates to true, then the ranges intersect.- Parameters:
range
- range to combine with this rangeconsiderInheritance
- whether inheritance information should be taken into account or not- Returns:
- true when the ranges intersect,
considerInheritance
is not set, or if set, both ranges have the same inheritance; otherwise false
-
contains
Says whether this range contains the specifiedrange
depending on inheritance or not.- Parameters:
range
- range to checkconsiderInheritance
- whether inheritance information should be taken into account or not- Returns:
- true if this range contains the
specified
range
; otherwise false
-
intersects
Says whether this range intersects the specifiedrange
depending on inheritance or not.- Parameters:
range
- range to checkconsiderInheritance
- whether inheritance information should be taken into account or not- Returns:
- true if this range intersects the
specified
range
; otherwise false
-
swapEndPoints
Swaps the start revision and the end revision of this merge range object.- Returns:
- this object itself
-
isInheritable
public boolean isInheritable()Tells whether this merge range should be inherited by treewise descendants of the path to which the range applies.- Returns:
- true if inheritable; otherwise false
-
setInheritable
public void setInheritable(boolean isInheritable) Sets whether this merge range is inheritable or not. This method is used bySVNKit
internals and is not intended for API users.- Parameters:
isInheritable
- whether this range is inheritable or not
-
dup
Makes an exact copy of this object.- Returns:
- exact copy of this object
-
toString
Return a string representation of this object.
-