Package org.tmatesoft.svn.core
Class SVNMergeRange
java.lang.Object
org.tmatesoft.svn.core.SVNMergeRange
- All Implemented Interfaces:
java.lang.Comparable
public class SVNMergeRange
extends java.lang.Object
implements java.lang.Comparable
The SVNMergeRange class represents a range of merged revisions.
- Since:
- 1.2
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate booleanprivate long -
Constructor Summary
ConstructorsConstructorDescriptionSVNMergeRange(long startRevision, long endRevision, boolean isInheritable) Constructs a newSVNMergeRangeobject. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCombine(SVNMergeRange range, boolean considerInheritance) Tells whether this range can me combined with the givenrangedepending on inheritance or not.combine(SVNMergeRange range, boolean considerInheritance) Combines this merge range and the givenrangeinto a single one.intcompareTo(java.lang.Object o) Compares this object to another one.booleancontains(SVNMergeRange range, boolean considerInheritance) Says whether this range contains the specifiedrangedepending on inheritance or not.dup()Makes an exact copy of this object.booleanequals(java.lang.Object obj) Says if this object is equal toobjor not.longReturns the end revision of this merge range.longReturns the start revision of this merge range.booleanintersects(SVNMergeRange range, boolean considerInheritance) Says whether this range intersects the specifiedrangedepending on inheritance or not.booleanTells whether this merge range should be inherited by treewise descendants of the path to which the range applies.voidsetEndRevision(long endRevision) Sets the end revision of this merge range.voidsetInheritable(boolean isInheritable) Sets whether this merge range is inheritable or not.voidsetStartRevision(long startRevision) Sets the start revision of this merge range.Swaps the start revision and the end revision of this merge range object.java.lang.StringtoString()Return a string representation of this object.Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
myStartRevision
private long myStartRevision -
myEndRevision
private long myEndRevision -
myIsInheritable
private boolean myIsInheritable
-
-
Constructor Details
-
SVNMergeRange
public SVNMergeRange(long startRevision, long endRevision, boolean isInheritable) Constructs a newSVNMergeRangeobject.- 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 bySVNKitinternals 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 bySVNKitinternals and is not intended for API users.- Parameters:
startRevision- merge range start revision
-
compareTo
public int compareTo(java.lang.Object o) Compares this object to another one. Note: merge rangeinheritanceis not taken into account when comparing twoSVNMergeRangeobjects.- Specified by:
compareToin interfacejava.lang.Comparable- Parameters:
o- object to compare to- Returns:
0ifois exactly this object oro.getStartRevision() == this.getStartRevision() && o.getEndRevision() == this.getEndRevision();-1if eitherthis.getStartRevision() < o.getStartRevision()orthis.getStartRevision() == o.getStartRevision() && this.getEndRevision() < o.getEndRevision();1if eitherthis.getStartRevision() > o.getStartRevision()orthis.getStartRevision() == o.getStartRevision() && this.getEndRevision() > o.getEndRevision()
-
equals
public boolean equals(java.lang.Object obj) Says if this object is equal toobjor not. Identical tothis.compareTo(obj) == 0.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- object ot compare to- Returns:
- true if equal; otherwise false
-
combine
Combines this merge range and the givenrangeinto 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 givenrangedepending 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,
considerInheritanceis not set, or if set, both ranges have the same inheritance; otherwise false
-
contains
Says whether this range contains the specifiedrangedepending 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 specifiedrangedepending 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 bySVNKitinternals 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
public java.lang.String toString()Return a string representation of this object.- Overrides:
toStringin classjava.lang.Object- Returns:
- this object as a string
-