OpenAPI 1.0

com.aquafold.openapi.compare
Interface AQComparator


public interface AQComparator

This interface defines a line-oriented text comparator.

Please refer to AQDifferences for more details on the generated result.


Method Summary
 AQDifferences compare(AQServerObject a, AQServerObject b)
          This method compares CREATE scripts of two server objects.
 AQDifferences compareText(String a, String b)
          This method compares two text strings line-by-line, based on configured settings.
 AQCompareOptions getCompareOptions()
          Returns a mutable object which allows for setting comparison options.
 void setIgnoreCase(boolean on)
          A shortcut method to configure the comparator to ignore case.
 void setIgnoreSpaces(boolean on)
          A shortcut method to configure the comparator to ignore:
 

Method Detail

compare

AQDifferences compare(AQServerObject a,
                      AQServerObject b)
                      throws Exception
This method compares CREATE scripts of two server objects. The compare method uses the Hunt-McIlroy algorithm, the same algorithm used in UNIX diff.

The following server objects are currently supported: AQTable, AQConstraint, AQDatabase, AQArrayType, AQCluster, AQMatView, AQObjectType, AQPackage, AQPackageBody, AQProcedure, AQSchema, AQSequence, AQTableType, AQTrigger, AQDatabaseLink, AQDataType, AQDefault, AQFunction, AQIndex, AQRole, AQRule, AQSynonym, AQUser, AQView, AQEvent, AQNickname

Parameters:
a - First server object to compare; required.
b - Second server object to compare; required.
Returns:
An AQDifferences object.
Throws:
Exception

compareText

AQDifferences compareText(String a,
                          String b)
                          throws Exception
This method compares two text strings line-by-line, based on configured settings. The lines are separated by <LF> or <CR> characters. The compare method uses the Hunt-McIlroy algorithm, the same algorithm used in UNIX diff.

Parameters:
a - First text string to compare; required. Empty string is acceptable; null is not.
b - Second text string to compare; required. Empty string is acceptable; null is not.
Returns:
An AQDifferences object.
Throws:
Exception

setIgnoreSpaces

void setIgnoreSpaces(boolean on)
A shortcut method to configure the comparator to ignore:

Please use getCompareOptions() method for finer control over comparison options.

Parameters:
on - When set, the comparator will ignore spaces.

setIgnoreCase

void setIgnoreCase(boolean on)
A shortcut method to configure the comparator to ignore case. Please use getCompareOptions() method for finer control over comparison options.

Parameters:
on - When set, the comparator will ignore case.

getCompareOptions

AQCompareOptions getCompareOptions()
Returns a mutable object which allows for setting comparison options. The options must be set prior to the first comparison operation.


OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.