站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

ArrayDiff (Tab Control) - NetBeans API Javadoc (Current Development Version)

org.netbeans.swing.tabcontrol 1.8

org.netbeans.swing.tabcontrol.event
Class ArrayDiff

java.lang.Object
  extended by org.netbeans.swing.tabcontrol.event.ArrayDiff

public final class ArrayDiff
extends Object

Class representing a diff of two arrays. Note that it is not designed to work with arrays which contain the same element more than one time - in that case, the results are undefined.

Note the current implementation is unoptimized and fairly brute force.


Method Summary
static ArrayDiff createDiff(TabData[] old, TabData[] nue)
          Returns an ArrayDiff object if the two arrays are not the same, or null if they are
 boolean equals(Object o)
           
 Set<Integer> getAddedIndices()
          Returns the indices of objects in the new array which are not present in the old array
 Set<Integer> getChangedIndices()
          Returns the indices of objects which differ in any way between the new and old array.
 Set<Integer> getDeletedIndices()
          Returns the indices of objects in the old array which are not present in the new array.
 Set<Integer> getMovedIndices()
          Returns the indices of objects which were in the old array and are also in the new array, but at a different index.
 TabData[] getNewData()
          Get the array representing the new state
 TabData[] getOldData()
          Get the array representing the old state
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getOldData

public TabData[] getOldData()
Get the array representing the old state


getNewData

public TabData[] getNewData()
Get the array representing the new state


createDiff

public static ArrayDiff createDiff(TabData[] old,
                                   TabData[] nue)
Returns an ArrayDiff object if the two arrays are not the same, or null if they are


getDeletedIndices

public Set<Integer> getDeletedIndices()
Returns the indices of objects in the old array which are not present in the new array. The resulting array's size will be that of the old array


getAddedIndices

public Set<Integer> getAddedIndices()
Returns the indices of objects in the new array which are not present in the old array


getChangedIndices

public Set<Integer> getChangedIndices()
Returns the indices of objects which differ in any way between the new and old array. The size of the result is Math.max(old.length, nue.length).


getMovedIndices

public Set<Integer> getMovedIndices()
Returns the indices of objects which were in the old array and are also in the new array, but at a different index. The indices returned are indices into the old array.


toString

public String toString()
Overrides:
toString in class Object

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

org.netbeans.swing.tabcontrol 1.8

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.