public static boolean areElementEquals ( Element element1 , Element element2 ) { for ( Mask mask1 : element1 . getMask ( ) ) { if ( ! areBooleanEquals ( element1 . isNegated ( ) , element2 . isNegated ( ) ) ) { // Negated. return false ; } for ( Mask mask2 : element2 . getMask ( ) ) { if ( ! areStringEquals ( mask1 . getLexemeMask ( ) , mask2 . getLexemeMask ( ) ) ) { // LexemeMask. return false ; } else if ( ! areStringEquals ( mask1 . getPrimitiveMask ( ) , mask2 . getPrimitiveMask ( ) ) ) { // PrimitiveMask. return false ; } else if ( ! areTagMaskEquals ( mask1 . getTagMask ( ) , mask2 . getTagMask ( ) ) ) { // TagMask. return false ; } } } return true ; }
Checks if two elements are equals .