Package aQute.bnd.differ
Class DiffImpl
- java.lang.Object
-
- aQute.bnd.differ.DiffImpl
-
public class DiffImpl extends java.lang.Object implements Diff, java.lang.Comparable<DiffImpl>, java.util.Formattable
A DiffImpl class compares a newer Element to an older Element. The Element classes hide all the low level details. A Element class is either either Structured (has children) or it is a Leaf, it only has a value. The constructor will first build its children (if any) and then calculate the delta. Each comparable element is translated to an Element. If necessary the Element can be sub classed to provide special behavior.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface aQute.bnd.service.diff.Diff
Diff.Data, Diff.Ignore
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(DiffImpl other)
boolean
equals(java.lang.Object other)
void
formatTo(java.util.Formatter formatter, int flags, int width, int precision)
Diff
get(java.lang.String name)
java.util.Collection<? extends Diff>
getChildren()
Delta
getDelta()
Return the absolute delta.Delta
getDelta(Diff.Ignore ignore)
This getDelta calculates the delta but allows the caller to ignore certain Diff objects by calling back the ignore call back parameter.java.lang.String
getName()
Tree
getNewer()
Tree
getOlder()
Type
getType()
int
hashCode()
Diff.Data
serialize()
java.lang.String
toString()
-
-
-
Method Detail
-
getDelta
public Delta getDelta()
Return the absolute delta. Also seegetDelta(aQute.bnd.service.diff.Diff.Ignore)
that allows you to ignore Diff objects on the fly (and calculate their parents accordingly).
-
getDelta
public Delta getDelta(Diff.Ignore ignore)
This getDelta calculates the delta but allows the caller to ignore certain Diff objects by calling back the ignore call back parameter. This can be useful to ignore warnings/errors.
-
getChildren
public java.util.Collection<? extends Diff> getChildren()
- Specified by:
getChildren
in interfaceDiff
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(DiffImpl other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<DiffImpl>
-
formatTo
public void formatTo(java.util.Formatter formatter, int flags, int width, int precision)
- Specified by:
formatTo
in interfacejava.util.Formattable
-
-