Java Doc for Diff.java in  » ERP-CRM-Financial » sakai » org » apache » commons » jrcs » diff » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » sakai » org.apache.commons.jrcs.diff 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.jrcs.util.ToString
      org.apache.commons.jrcs.diff.Diff

Diff
public class Diff extends ToString (Code)
Implements a differencing engine that works on arrays of Object 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 hashCode() and java.lang.Object.equals 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 specififed, a default algorithm is used.


version:
   $Revision: 7756 $ $Date: 2006-04-12 18:30:19 +0100 (Wed, 12 Apr
version:
   2006) $
author:
   Juanco Anez
See Also:   Delta
See Also:   DiffAlgorithm
See Also:    modifications: 27 Apr 2003 bwm Added some comments whilst
See Also:   trying to figure out the algorithm 03 May 2003 bwm Factored out the
See Also:   algorithm implementation into a separate difference algorithm class to
See Also:   allow pluggable algorithms.


Field Summary
final public static  StringNL
     The standard line separator.
final public static  StringRCS_EOL
     The line separator to use in RCS format output.
protected  DiffAlgorithmalgorithm
     The differencing algorithm to use.
final protected  Object[]orig
     The original sequence.

Constructor Summary
public  Diff(Object[] original)
    
public  Diff(Object[] original, DiffAlgorithm algorithm)
    

Method Summary
public static  StringarrayToString(Object[] o)
     Converts an array of Object Object to a string using Diff.NL Diff.NL as the line separator.
public static  booleancompare(Object[] orig, Object[] rev)
     Compares the two input sequences.
Parameters:
  orig - The original sequence.
Parameters:
  rev - The revised sequence.
protected  DiffAlgorithmdefaultAlgorithm()
    
public static  Revisiondiff(Object[] orig, Object[] rev)
     compute the difference between an original and a revision.
Parameters:
  orig - the original
Parameters:
  rev - the revision to compare with the original.
public static  Revisiondiff(Object[] orig, Object[] rev, DiffAlgorithm algorithm)
     compute the difference between an original and a revision.
public  Revisiondiff(Object[] rev)
     compute the difference between the original and a revision.
Parameters:
  rev - the revision to compare with the original.
public static  Object[]editAll(Object[] text)
     Edits all of the items in the input sequence.
Parameters:
  text - The input sequence.
public static  Object[]randomEdit(Object[] text)
     Performs random edits on the input sequence.
public static  Object[]randomEdit(Object[] text, long seed)
     Performs random edits on the input sequence.
public static  Object[]randomSequence(int size)
     Generate a random sequence of the given size.
Parameters:
  The - size of the sequence to generate.
public static  Object[]randomSequence(int size, long seed)
     Generate a random sequence of the given size.
Parameters:
  The - size of the sequence to generate.
Parameters:
  seed - A seed value for randomizing the generation.
public static  Object[]shuffle(Object[] text)
     Shuffles around the items in the input sequence.
Parameters:
  text - The input sequence.
public static  Object[]shuffle(Object[] text, long seed)
     Shuffles around the items in the input sequence.
Parameters:
  text - The input sequence.
Parameters:
  seed - A seed value for randomizing the suffle.

Field Detail
NL
final public static String NL(Code)
The standard line separator.



RCS_EOL
final public static String RCS_EOL(Code)
The line separator to use in RCS format output.



algorithm
protected DiffAlgorithm algorithm(Code)
The differencing algorithm to use.



orig
final protected Object[] orig(Code)
The original sequence.




Constructor Detail
Diff
public Diff(Object[] original)(Code)
Create a differencing object using the default algorithm
Parameters:
  the - original text that will be compared



Diff
public Diff(Object[] original, DiffAlgorithm algorithm)(Code)
Create a differencing object using the given algorithm
Parameters:
  o - the original text which will be compared against
Parameters:
  algorithm - the difference algorithm to use.




Method Detail
arrayToString
public static String arrayToString(Object[] o)(Code)
Converts an array of Object Object to a string using Diff.NL Diff.NL as the line separator.
Parameters:
  o - the array of objects.



compare
public static boolean compare(Object[] orig, Object[] rev)(Code)
Compares the two input sequences.
Parameters:
  orig - The original sequence.
Parameters:
  rev - The revised sequence. true if the sequences are identical. False otherwise.



defaultAlgorithm
protected DiffAlgorithm defaultAlgorithm()(Code)



diff
public static Revision diff(Object[] orig, Object[] rev) throws DifferentiationFailedException(Code)
compute the difference between an original and a revision.
Parameters:
  orig - the original
Parameters:
  rev - the revision to compare with the original. a Revision describing the differences



diff
public static Revision diff(Object[] orig, Object[] rev, DiffAlgorithm algorithm) throws DifferentiationFailedException(Code)
compute the difference between an original and a revision.
Parameters:
  orig - the original
Parameters:
  rev - the revision to compare with the original.
Parameters:
  algorithm - the difference algorithm to use a Revision describing the differences



diff
public Revision diff(Object[] rev) throws DifferentiationFailedException(Code)
compute the difference between the original and a revision.
Parameters:
  rev - the revision to compare with the original. a Revision describing the differences



editAll
public static Object[] editAll(Object[] text)(Code)
Edits all of the items in the input sequence.
Parameters:
  text - The input sequence. A sequence of the same length with all the lines differing fromthe corresponding ones in the input.



randomEdit
public static Object[] randomEdit(Object[] text)(Code)
Performs random edits on the input sequence. Useful for testing.
Parameters:
  text - The input sequence. The sequence with random edits performed.



randomEdit
public static Object[] randomEdit(Object[] text, long seed)(Code)
Performs random edits on the input sequence. Useful for testing.
Parameters:
  text - The input sequence.
Parameters:
  seed - A seed value for the randomizer. The sequence with random edits performed.



randomSequence
public static Object[] randomSequence(int size)(Code)
Generate a random sequence of the given size.
Parameters:
  The - size of the sequence to generate. The generated sequence.



randomSequence
public static Object[] randomSequence(int size, long seed)(Code)
Generate a random sequence of the given size.
Parameters:
  The - size of the sequence to generate.
Parameters:
  seed - A seed value for randomizing the generation. The generated sequence.



shuffle
public static Object[] shuffle(Object[] text)(Code)
Shuffles around the items in the input sequence.
Parameters:
  text - The input sequence. The shuffled sequence.



shuffle
public static Object[] shuffle(Object[] text, long seed)(Code)
Shuffles around the items in the input sequence.
Parameters:
  text - The input sequence.
Parameters:
  seed - A seed value for randomizing the suffle. The shuffled sequence.



Methods inherited from org.apache.commons.jrcs.util.ToString
public static String arrayToString(Object[] o)(Code)(Java Doc)
public static String arrayToString(Object[] o, String EOL)(Code)(Java Doc)
public static String[] stringToArray(String value)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public void toString(StringBuffer s)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.