org.suigeneris.jrcs.diff
Class DiffHelper

java.lang.Object
  extended by org.suigeneris.jrcs.util.ToString
      extended by org.suigeneris.jrcs.diff.DiffHelper

public class DiffHelper
extends ToString

Provides methods useful for setting up differencing scenarios.

Author:
juanca

Constructor Summary
DiffHelper()
           
 
Method Summary
static java.lang.Object[] editAll(java.lang.Object[] text)
          Edits all of the items in the input sequence.
static java.lang.Object[] randomEdit(java.lang.Object[] text)
          Performs random edits on the input sequence.
static java.lang.Object[] randomEdit(java.lang.Object[] text, long seed)
          Performs random edits on the input sequence.
static java.lang.Object[] randomSequence(int size)
          Generate a random sequence of the given size.
static java.lang.Object[] randomSequence(int size, long seed)
          Generate a random sequence of the given size.
static java.lang.Object[] shuffle(java.lang.Object[] text)
          Shuffles around the items in the input sequence.
static java.lang.Object[] shuffle(java.lang.Object[] text, long seed)
          Shuffles around the items in the input sequence.
 
Methods inherited from class org.suigeneris.jrcs.util.ToString
arrayToString, arrayToString, stringToArray, stringToArray, toString, toString, toStringOfChars
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiffHelper

public DiffHelper()
Method Detail

editAll

public static java.lang.Object[] editAll(java.lang.Object[] text)
Edits all of the items in the input sequence.

Parameters:
text - The input sequence.
Returns:
A sequence of the same length with all the lines differing from the corresponding ones in the input.

randomEdit

public static java.lang.Object[] randomEdit(java.lang.Object[] text)
Performs random edits on the input sequence. Useful for testing.

Parameters:
text - The input sequence.
Returns:
The sequence with random edits performed.

randomEdit

public static java.lang.Object[] randomEdit(java.lang.Object[] text,
                                            long seed)
Performs random edits on the input sequence. Useful for testing.

Parameters:
text - The input sequence.
seed - A seed value for the randomizer.
Returns:
The sequence with random edits performed.

shuffle

public static java.lang.Object[] shuffle(java.lang.Object[] text)
Shuffles around the items in the input sequence.

Parameters:
text - The input sequence.
Returns:
The shuffled sequence.

shuffle

public static java.lang.Object[] shuffle(java.lang.Object[] text,
                                         long seed)
Shuffles around the items in the input sequence.

Parameters:
text - The input sequence.
seed - A seed value for randomizing the suffle.
Returns:
The shuffled sequence.

randomSequence

public static java.lang.Object[] randomSequence(int size)
Generate a random sequence of the given size.

Parameters:
The - size of the sequence to generate.
Returns:
The generated sequence.

randomSequence

public static java.lang.Object[] randomSequence(int size,
                                                long seed)
Generate a random sequence of the given size.

Parameters:
The - size of the sequence to generate.
seed - A seed value for randomizing the generation.
Returns:
The generated sequence.


Copyright © 1999-2006 Juancarlo Añez, Caracas, Venezuela.
Some rights reserved
. http://www.suigeneris.org/jrcs