net.sourceforge.xwing.util
Class SequenceUtils

java.lang.Object
  extended bynet.sourceforge.xwing.util.SequenceUtils

public class SequenceUtils
extends Object

A utility class that reports simple difference information between two sequences.

Version:
$Revision: 1.2 $
Author:
Scott Howlett

Nested Class Summary
static class SequenceUtils.ChangeInfo
          A class that encapsulates the information about the change from an old sequence to a new sequence.
 
Field Summary
static int COMPLEX_CHANGE
          The new sequence and the old sequence differ by some change that is more complex than a single insert or remove.
static int INTERVAL_ADDED
          The new sequence differs from the old sequence by having a set of values inserted into it at a single point.
static int INTERVAL_REMOVED
          The new sequence differs from the old sequence by having a set of values removed from it at a single point.
static int NO_CHANGE
          The two sequences are the same.
 
Method Summary
static SequenceUtils.ChangeInfo findDifference(Collection oldData, Collection newData)
          Report on the difference betwen two Collections.
static SequenceUtils.ChangeInfo findDifference(Object[] oldData, Object[] newData)
          Report on the difference betwen two Arrays.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_CHANGE

public static final int NO_CHANGE
The two sequences are the same.

See Also:
Constant Field Values

INTERVAL_ADDED

public static final int INTERVAL_ADDED
The new sequence differs from the old sequence by having a set of values inserted into it at a single point.

See Also:
Constant Field Values

INTERVAL_REMOVED

public static final int INTERVAL_REMOVED
The new sequence differs from the old sequence by having a set of values removed from it at a single point.

See Also:
Constant Field Values

COMPLEX_CHANGE

public static final int COMPLEX_CHANGE
The new sequence and the old sequence differ by some change that is more complex than a single insert or remove.

See Also:
Constant Field Values
Method Detail

findDifference

public static SequenceUtils.ChangeInfo findDifference(Collection oldData,
                                                      Collection newData)
Report on the difference betwen two Collections.

Parameters:
oldData - The old sequence.
newData - The new sequence.
Returns:
A ChangeInfo describing the change.

findDifference

public static SequenceUtils.ChangeInfo findDifference(Object[] oldData,
                                                      Object[] newData)
Report on the difference betwen two Arrays.

Parameters:
oldData - The old sequence.
newData - The new sequence.
Returns:
A ChangeInfo describing the change.


Copyright © 2003 The Xwing Project. All Rights Reserved.