org.cogroo.tools.checker.rules.util
Class EqualsUtils

java.lang.Object
  extended by org.cogroo.tools.checker.rules.util.EqualsUtils

public class EqualsUtils
extends Object

Utility class to compare patterns Elements, Compositions, TagMasks, Booleans and Strings.

Author:
Marcelo Suzumura, William Colen

Constructor Summary
EqualsUtils()
           
 
Method Summary
static boolean areBooleanEquals(Boolean boolean1, Boolean boolean2)
          Checks if two Booleans are equals.
static boolean areCompositionEquals(Composition c1, Composition c2)
           
static boolean areElementEquals(Element element1, Element element2)
          Checks if two elements are equals.
static boolean arePatternElementEquals(PatternElement p1, PatternElement p2)
           
static boolean areStringEquals(String string1, String string2)
          Checks if two strings are equals.
static boolean areTagMaskEquals(TagMask tagMask1, TagMask tagMask2)
          Checks if two tag masks are equals.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EqualsUtils

public EqualsUtils()
Method Detail

arePatternElementEquals

public static boolean arePatternElementEquals(PatternElement p1,
                                              PatternElement p2)

areCompositionEquals

public static boolean areCompositionEquals(Composition c1,
                                           Composition c2)

areElementEquals

public static boolean areElementEquals(Element element1,
                                       Element element2)
Checks if two elements are equals.

Parameters:
element1 - from tree element Element
element2 - from rule element Element
Returns:
true if the elements are equal, false otherwise

areTagMaskEquals

public static boolean areTagMaskEquals(TagMask tagMask1,
                                       TagMask tagMask2)
Checks if two tag masks are equals. The tag masks can be both null, one of them null or none of them null.

Parameters:
tagMask1 - from tree element TagMask
tagMask2 - from rule element TagMask
Returns:
true if equals, otherwise

areBooleanEquals

public static boolean areBooleanEquals(Boolean boolean1,
                                       Boolean boolean2)
Checks if two Booleans are equals. The booleans can be both null, one of them null or none of them null.

Parameters:
boolean1 - from tree tree element
boolean2 - from rule element
Returns:
true if and only if the two booleans are equal (both equal or both null)

areStringEquals

public static boolean areStringEquals(String string1,
                                      String string2)
Checks if two strings are equals. The strings can be both null, one of them null or none of them null.

Parameters:
string1 - from tree element
string2 - from rule element
Returns:
true if and only if the two strings are equal (both equal or both null)


Copyright © 2012-2013 CoGrOO. All Rights Reserved.