congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Diff
Code IndexAdd Tabnine to your IDE (free)

How to use
Diff
in
org.apache.wicket.util.diff

Best Java code snippets using org.apache.wicket.util.diff.Diff (Showing top 20 results out of 315)

origin: org.apache.wicket/wicket-util

/**
 * compute the difference between an original and a revision.
 * 
 * @param orig
 *            the original
 * @param rev
 *            the revision to compare with the original.
 * @param algorithm
 *            the difference algorithm to use
 * @return a Revision describing the differences
 * @throws DifferentiationFailedException
 */
public static Revision diff(final Object[] orig, final Object[] rev,
  final DiffAlgorithm algorithm) throws DifferentiationFailedException
{
  if ((orig == null) || (rev == null))
  {
    throw new IllegalArgumentException();
  }
  return new Diff(orig, algorithm).diff(rev);
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Converts an array of {@link Object Object} to a string using {@link Diff#NL Diff.NL} as the
 * line separator.
 * 
 * @param o
 *            the array of objects.
 * @return String
 */
public static String arrayToString(Object[] o)
{
  return arrayToString(o, Diff.NL);
}
origin: org.apache.wicket/wicket-util

/**
 * Performs random edits on the input sequence. Useful for testing.
 * 
 * @param text
 *            The input sequence.
 * @return The sequence with random edits performed.
 */
public static Object[] randomEdit(final Object[] text)
{
  return randomEdit(text, text.length);
}
origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * compute the difference between an original and a revision.
 * 
 * @param orig
 *            the original
 * @param rev
 *            the revision to compare with the original.
 * @return a Revision describing the differences
 * @throws DifferentiationFailedException
 */
public static Revision diff(Object[] orig, Object[] rev) throws DifferentiationFailedException
{
  if (orig == null || rev == null)
  {
    throw new IllegalArgumentException();
  }
  return diff(orig, rev, null);
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Shuffles around the items in the input sequence.
 * 
 * @param text
 *            the input sequence.
 * @return The shuffled sequence.
 */
public static Object[] shuffle(Object[] text)
{
  return shuffle(text, text.length);
}
origin: org.apache.wicket/wicket-util

/**
 * Generate a random sequence of the given size.
 * 
 * @param size
 *            the size of the sequence to generate.
 * @return The generated sequence.
 */
public static Object[] randomSequence(final int size)
{
  return randomSequence(size, size);
}
origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Create a differencing object using the given algorithm
 * 
 * @param original
 *            the original text that will be compared
 * @param algorithm
 *            the difference algorithm to use.
 */
public Diff(Object[] original, DiffAlgorithm algorithm)
{
  if (original == null)
  {
    throw new IllegalArgumentException();
  }
  orig = original;
  if (algorithm != null)
  {
    this.algorithm = algorithm;
  }
  else
  {
    this.algorithm = defaultAlgorithm();
  }
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * compute the difference between an original and a revision.
 * 
 * @param orig
 *            the original
 * @param rev
 *            the revision to compare with the original.
 * @return a Revision describing the differences
 * @throws DifferentiationFailedException
 */
public static Revision diff(Object[] orig, Object[] rev) throws DifferentiationFailedException
{
  if (orig == null || rev == null)
  {
    throw new IllegalArgumentException();
  }
  return diff(orig, rev, null);
}
origin: org.apache.wicket/wicket-util

/**
 * Shuffles around the items in the input sequence.
 * 
 * @param text
 *            the input sequence.
 * @return The shuffled sequence.
 */
public static Object[] shuffle(final Object[] text)
{
  return shuffle(text, text.length);
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Generate a random sequence of the given size.
 * 
 * @param size
 *            the size of the sequence to generate.
 * @return The generated sequence.
 */
public static Object[] randomSequence(int size)
{
  return randomSequence(size, size);
}
origin: org.apache.wicket/wicket-util

/**
 * Create a differencing object using the given algorithm
 * 
 * @param original
 *            the original text that will be compared
 * @param algorithm
 *            the difference algorithm to use.
 */
public Diff(final Object[] original, final DiffAlgorithm algorithm)
{
  if (original == null)
  {
    throw new IllegalArgumentException();
  }
  orig = original;
  if (algorithm != null)
  {
    this.algorithm = algorithm;
  }
  else
  {
    this.algorithm = defaultAlgorithm();
  }
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * compute the difference between an original and a revision.
 * 
 * @param orig
 *            the original
 * @param rev
 *            the revision to compare with the original.
 * @param algorithm
 *            the difference algorithm to use
 * @return a Revision describing the differences
 * @throws DifferentiationFailedException
 */
public static Revision diff(Object[] orig, Object[] rev, DiffAlgorithm algorithm)
    throws DifferentiationFailedException
{
  if (orig == null || rev == null)
  {
    throw new IllegalArgumentException();
  }
  return new Diff(orig, algorithm).diff(rev);
}
origin: org.apache.wicket/wicket-util

/**
 * compute the difference between an original and a revision.
 * 
 * @param orig
 *            the original
 * @param rev
 *            the revision to compare with the original.
 * @return a Revision describing the differences
 * @throws DifferentiationFailedException
 */
public static Revision diff(final Object[] orig, final Object[] rev)
  throws DifferentiationFailedException
{
  if ((orig == null) || (rev == null))
  {
    throw new IllegalArgumentException();
  }
  return diff(orig, rev, null);
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Performs random edits on the input sequence. Useful for testing.
 * 
 * @param text
 *            The input sequence.
 * @return The sequence with random edits performed.
 */
public static Object[] randomEdit(Object[] text)
{
  return randomEdit(text, text.length);
}
origin: org.apache.wicket/wicket-util

/**
 * Converts an array of {@link Object Object} to a string using {@link Diff#NL Diff.NL} as the
 * line separator.
 * 
 * @param o
 *            the array of objects.
 * @return String
 */
public static String arrayToString(final Object[] o)
{
  return arrayToString(o, Diff.NL);
}
origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Shuffles around the items in the input sequence.
 * 
 * @param text
 *            the input sequence.
 * @return The shuffled sequence.
 */
public static Object[] shuffle(Object[] text)
{
  return shuffle(text, text.length);
}
origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Generate a random sequence of the given size.
 * 
 * @param size
 *            the size of the sequence to generate.
 * @return The generated sequence.
 */
public static Object[] randomSequence(int size)
{
  return randomSequence(size, size);
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Create a differencing object using the given algorithm
 * 
 * @param original
 *            the original text that will be compared
 * @param algorithm
 *            the difference algorithm to use.
 */
public Diff(Object[] original, DiffAlgorithm algorithm)
{
  if (original == null)
  {
    throw new IllegalArgumentException();
  }
  orig = original;
  if (algorithm != null)
  {
    this.algorithm = algorithm;
  }
  else
  {
    this.algorithm = defaultAlgorithm();
  }
}
origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * compute the difference between an original and a revision.
 * 
 * @param orig
 *            the original
 * @param rev
 *            the revision to compare with the original.
 * @param algorithm
 *            the difference algorithm to use
 * @return a Revision describing the differences
 * @throws DifferentiationFailedException
 */
public static Revision diff(Object[] orig, Object[] rev, DiffAlgorithm algorithm)
  throws DifferentiationFailedException
{
  if (orig == null || rev == null)
  {
    throw new IllegalArgumentException();
  }
  return new Diff(orig, algorithm).diff(rev);
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

public boolean checkLicenseHeader(File file)
{
  Revision revision = null;
  try
  {
    String header = extractLicenseHeader(file, 0, 16);
    revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING));
  }
  catch (Exception e)
  {
    Assert.fail(e.getMessage());
  }
  return revision.size() == 0;
}
org.apache.wicket.util.diffDiff

Javadoc

Implements a differencing engine that works on arrays of Object.

Within this library, the word text means a unit of information subject to version control.

Text is represented as Object[] because the diff engine is capable of handling more than plain ascci. In fact, arrays of any type that implements java.lang.Object#hashCode and java.lang.Object#equals correctly can be subject to differencing using this library.

This library provides a framework in which different differencing algorithms may be used. If no algorithm is specified, a default algorithm is used.

Most used methods

  • <init>
    Create a differencing object using the given algorithm
  • diff
    compute the difference between an original and a revision.
  • arrayToString
  • defaultAlgorithm
  • randomEdit
    Performs random edits on the input sequence. Useful for testing.
  • randomSequence
    Generate a random sequence of the given size.
  • shuffle
    Shuffles around the items in the input sequence.

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JFileChooser (javax.swing)
  • JList (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now