Codota Logo
Diff
Code IndexAdd Codota 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)

  • Common ways to obtain Diff
private void myMethod () {
Diff d =
  • Codota IconObject[] original;new Diff(original)
  • Smart code suggestions by Codota
}
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

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • findViewById (Activity)
  • getContentResolver (Context)
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • Reference (javax.naming)
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • BoxLayout (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now