aQute.bnd.differ
Class DiffImpl

java.lang.Object
  extended by aQute.bnd.differ.DiffImpl
All Implemented Interfaces:
Diff, Comparable<DiffImpl>

public class DiffImpl
extends Object
implements Diff, Comparable<DiffImpl>

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
 
Constructor Summary
DiffImpl(Tree newer, Tree older)
          Compares the newer against the older, traversing the children if necessary.
 
Method Summary
 int compareTo(DiffImpl other)
           
 boolean equals(Object other)
           
 Diff get(String name)
           
 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.
 String getName()
           
 Tree getNewer()
           
 Tree getOlder()
           
 Type getType()
           
 int hashCode()
           
 Diff.Data serialize()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiffImpl

public DiffImpl(Tree newer,
                Tree older)
Compares the newer against the older, traversing the children if necessary.

Parameters:
newer - The newer Element
older - The older Element
types -
Method Detail

getDelta

public Delta getDelta()
Return the absolute delta. Also see getDelta(aQute.bnd.service.diff.Diff.Ignore) that allows you to ignore Diff objects on the fly (and calculate their parents accordingly).

Specified by:
getDelta in interface Diff

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.

Specified by:
getDelta in interface Diff

getType

public Type getType()
Specified by:
getType in interface Diff

getName

public String getName()
Specified by:
getName in interface Diff

getChildren

public Collection<? extends Diff> getChildren()
Specified by:
getChildren in interface Diff

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(DiffImpl other)
Specified by:
compareTo in interface Comparable<DiffImpl>

get

public Diff get(String name)
Specified by:
get in interface Diff

getOlder

public Tree getOlder()
Specified by:
getOlder in interface Diff

getNewer

public Tree getNewer()
Specified by:
getNewer in interface Diff

serialize

public Diff.Data serialize()
Specified by:
serialize in interface Diff


Copyright © 2014 aQute SARL. All rights reserved.