Eclipse Platform
Release 3.6

org.eclipse.core.databinding.observable
Class Diffs

java.lang.Object
  extended by org.eclipse.core.databinding.observable.Diffs

public class Diffs
extends Object

Since:
1.0

Constructor Summary
Diffs()
           
 
Method Summary
static ListDiff computeLazyListDiff(List oldList, List newList)
          Returns a lazily computed ListDiff describing the change between the specified old and new list states.
static MapDiff computeLazyMapDiff(Map oldMap, Map newMap)
          Returns a lazily computed MapDiff describing the change between the specified old and new map states.
static SetDiff computeLazySetDiff(Set oldSet, Set newSet)
          Returns a lazily computed SetDiff describing the change between the specified old and new set states.
static ListDiff computeListDiff(List oldList, List newList)
          Returns a ListDiff describing the change between the specified old and new list states.
static MapDiff computeMapDiff(Map oldMap, Map newMap)
          Returns a MapDiff describing the change between the specified old and new map states.
static SetDiff computeSetDiff(Set oldSet, Set newSet)
          Returns a SetDiff describing the change between the specified old and new set states.
static ListDiff createListDiff(ListDiffEntry difference)
           
static ListDiff createListDiff(ListDiffEntry[] differences)
           
static ListDiff createListDiff(ListDiffEntry difference1, ListDiffEntry difference2)
           
static ListDiffEntry createListDiffEntry(int position, boolean isAddition, Object element)
           
static MapDiff createMapDiff(Set addedKeys, Set removedKeys, Set changedKeys, Map oldValues, Map newValues)
           
static MapDiff createMapDiffRemoveAll(Map copyOfOldMap)
           
static MapDiff createMapDiffSingleAdd(Object addedKey, Object newValue)
           
static MapDiff createMapDiffSingleChange(Object existingKey, Object oldValue, Object newValue)
           
static MapDiff createMapDiffSingleRemove(Object removedKey, Object oldValue)
           
static SetDiff createSetDiff(Set additions, Set removals)
           
static ValueDiff createValueDiff(Object oldValue, Object newValue)
           
static boolean equals(Object left, Object right)
          Checks whether the two objects are null -- allowing for null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Diffs

public Diffs()
Method Detail

computeListDiff

public static ListDiff computeListDiff(List oldList,
                                       List newList)
Returns a ListDiff describing the change between the specified old and new list states.

Parameters:
oldList - the old list state
newList - the new list state
Returns:
the differences between oldList and newList

computeLazyListDiff

public static ListDiff computeLazyListDiff(List oldList,
                                           List newList)
Returns a lazily computed ListDiff describing the change between the specified old and new list states.

Parameters:
oldList - the old list state
newList - the new list state
Returns:
a lazily computed ListDiff describing the change between the specified old and new list states.
Since:
1.3

equals

public static final boolean equals(Object left,
                                   Object right)
Checks whether the two objects are null -- allowing for null.

Parameters:
left - The left object to compare; may be null.
right - The right object to compare; may be null.
Returns:
true if the two objects are equivalent; false otherwise.

computeSetDiff

public static SetDiff computeSetDiff(Set oldSet,
                                     Set newSet)
Returns a SetDiff describing the change between the specified old and new set states.

Parameters:
oldSet - the old set state
newSet - the new set state
Returns:
a SetDiff describing the change between the specified old and new set states.

computeLazySetDiff

public static SetDiff computeLazySetDiff(Set oldSet,
                                         Set newSet)
Returns a lazily computed SetDiff describing the change between the specified old and new set states.

Parameters:
oldSet - the old set state
newSet - the new set state
Returns:
a lazily computed SetDiff describing the change between the specified old and new set states.
Since:
1.3

computeMapDiff

public static MapDiff computeMapDiff(Map oldMap,
                                     Map newMap)
Returns a MapDiff describing the change between the specified old and new map states.

Parameters:
oldMap - the old map state
newMap - the new map state
Returns:
a MapDiff describing the change between the specified old and new map states.

computeLazyMapDiff

public static MapDiff computeLazyMapDiff(Map oldMap,
                                         Map newMap)
Returns a lazily computed MapDiff describing the change between the specified old and new map states.

Parameters:
oldMap - the old map state
newMap - the new map state
Returns:
a lazily computed MapDiff describing the change between the specified old and new map states.
Since:
1.3

createValueDiff

public static ValueDiff createValueDiff(Object oldValue,
                                        Object newValue)
Parameters:
oldValue -
newValue -
Returns:
a value diff

createSetDiff

public static SetDiff createSetDiff(Set additions,
                                    Set removals)
Parameters:
additions -
removals -
Returns:
a set diff

createListDiff

public static ListDiff createListDiff(ListDiffEntry difference)
Parameters:
difference -
Returns:
a list diff with one differing entry

createListDiff

public static ListDiff createListDiff(ListDiffEntry difference1,
                                      ListDiffEntry difference2)
Parameters:
difference1 -
difference2 -
Returns:
a list diff with two differing entries

createListDiff

public static ListDiff createListDiff(ListDiffEntry[] differences)
Parameters:
differences -
Returns:
a list diff with the given entries

createListDiffEntry

public static ListDiffEntry createListDiffEntry(int position,
                                                boolean isAddition,
                                                Object element)
Parameters:
position -
isAddition -
element -
Returns:
a list diff entry

createMapDiffSingleAdd

public static MapDiff createMapDiffSingleAdd(Object addedKey,
                                             Object newValue)
Parameters:
addedKey -
newValue -
Returns:
a map diff

createMapDiffSingleChange

public static MapDiff createMapDiffSingleChange(Object existingKey,
                                                Object oldValue,
                                                Object newValue)
Parameters:
existingKey -
oldValue -
newValue -
Returns:
a map diff

createMapDiffSingleRemove

public static MapDiff createMapDiffSingleRemove(Object removedKey,
                                                Object oldValue)
Parameters:
removedKey -
oldValue -
Returns:
a map diff

createMapDiffRemoveAll

public static MapDiff createMapDiffRemoveAll(Map copyOfOldMap)
Parameters:
copyOfOldMap -
Returns:
a map diff

createMapDiff

public static MapDiff createMapDiff(Set addedKeys,
                                    Set removedKeys,
                                    Set changedKeys,
                                    Map oldValues,
                                    Map newValues)
Parameters:
addedKeys -
removedKeys -
changedKeys -
oldValues -
newValues -
Returns:
a map diff

Eclipse Platform
Release 3.6

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.