@ -64,6 +64,8 @@ public final class ConfigurationPropertyName implements Comparable<Configuration
private String string ;
private int hashCode ;
private ConfigurationPropertyName ( Elements elements ) {
this . elements = elements ;
this . uniformElements = new CharSequence [ elements . getSize ( ) ] ;
@ -322,23 +324,39 @@ public final class ConfigurationPropertyName implements Comparable<Configuration
}
}
private boolean defaultElementEquals ( Elements e1 , Elements e2 , int i ) {
private boolean fastElementEquals ( Elements e1 , Elements e2 , int i ) {
int length1 = e1 . getLength ( i ) ;
int length2 = e2 . getLength ( i ) ;
if ( length1 = = length2 ) {
int i1 = 0 ;
while ( length1 - - ! = 0 ) {
char ch1 = e1 . charAt ( i , i1 ) ;
char ch2 = e2 . charAt ( i , i1 ) ;
if ( ch1 ! = ch2 ) {
return false ;
}
i1 + + ;
}
return true ;
}
return false ;
}
private boolean dashIgnoringElementEquals ( Elements e1 , Elements e2 , int i ) {
int l1 = e1 . getLength ( i ) ;
int l2 = e2 . getLength ( i ) ;
boolean indexed1 = e1 . getType ( i ) . isIndexed ( ) ;
boolean indexed2 = e2 . getType ( i ) . isIndexed ( ) ;
int i1 = 0 ;
int i2 = 0 ;
while ( i1 < l1 ) {
if ( i2 > = l2 ) {
return false ;
}
char ch1 = indexed1 ? e1 . charAt ( i , i1 ) : Character . toLowerCase ( e1 . charAt ( i , i1 ) ) ;
char ch2 = indexed2 ? e2 . charAt ( i , i2 ) : Character . toLowerCase ( e2 . charAt ( i , i2 ) ) ;
if ( ! indexed1 & & ! ElementsParser . isAlphaNumeric ( ch1 ) ) {
char ch1 = e1. charAt ( i , i1 ) ;
char ch2 = e2. charAt ( i , i2 ) ;
if ( ch1 = = '-' ) {
i1 + + ;
}
else if ( ! indexed2 & & ! ElementsParser . isAlphaNumeric ( ch2 ) ) {
else if ( ch2 = = '-' ) {
i2 + + ;
}
else if ( ch1 ! = ch2 ) {
@ -350,12 +368,12 @@ public final class ConfigurationPropertyName implements Comparable<Configuration
}
}
if ( i2 < l2 ) {
if ( indexed2 ) {
if ( e2. getType ( i ) . isIndexed ( ) ) {
return false ;
}
do {
char ch2 = Character. toLowerCase ( e2. charAt ( i , i2 + + ) ) ;
if ( ElementsParser. isAlphaNumeric ( ch2 ) ) {
char ch2 = e2. charAt ( i , i2 + + ) ;
if ( ch2 ! = '-' ) {
return false ;
}
}
@ -364,21 +382,23 @@ public final class ConfigurationPropertyName implements Comparable<Configuration
return true ;
}
private boolean d ashIgnoring ElementEquals( Elements e1 , Elements e2 , int i ) {
private boolean d efault ElementEquals( Elements e1 , Elements e2 , int i ) {
int l1 = e1 . getLength ( i ) ;
int l2 = e2 . getLength ( i ) ;
boolean indexed1 = e1 . getType ( i ) . isIndexed ( ) ;
boolean indexed2 = e2 . getType ( i ) . isIndexed ( ) ;
int i1 = 0 ;
int i2 = 0 ;
while ( i1 < l1 ) {
if ( i2 > = l2 ) {
return false ;
}
char ch1 = e1. charAt ( i , i1 ) ;
char ch2 = e2. charAt ( i , i2 ) ;
if ( ch1 = = '-' ) {
char ch1 = indexed1 ? e1. charAt ( i , i1 ) : Character . toLowerCase ( e1 . charAt ( i , i1 ) ) ;
char ch2 = indexed2 ? e2. charAt ( i , i2 ) : Character . toLowerCase ( e2 . charAt ( i , i2 ) ) ;
if ( ! indexed1 & & ! ElementsParser . isAlphaNumeric ( ch1 ) ) {
i1 + + ;
}
else if ( ch2 = = '-' ) {
else if ( ! indexed2 & & ! ElementsParser . isAlphaNumeric ( ch2 ) ) {
i2 + + ;
}
else if ( ch1 ! = ch2 ) {
@ -390,12 +410,12 @@ public final class ConfigurationPropertyName implements Comparable<Configuration
}
}
if ( i2 < l2 ) {
if ( e2. getType ( i ) . isIndexed ( ) ) {
if ( indexed2 ) {
return false ;
}
do {
char ch2 = e2. charAt ( i , i2 + + ) ;
if ( ch2 ! = '-' ) {
char ch2 = Character. toLowerCase ( e2. charAt ( i , i2 + + ) ) ;
if ( ElementsParser. isAlphaNumeric ( ch2 ) ) {
return false ;
}
}
@ -404,27 +424,28 @@ public final class ConfigurationPropertyName implements Comparable<Configuration
return true ;
}
private boolean fastElementEquals ( Elements e1 , Elements e2 , int i ) {
int length1 = e1 . getLength ( i ) ;
int length2 = e2 . getLength ( i ) ;
if ( length1 = = length2 ) {
int i1 = 0 ;
while ( length1 - - ! = 0 ) {
char ch1 = e1 . charAt ( i , i1 ) ;
char ch2 = e2 . charAt ( i , i1 ) ;
if ( ch1 ! = ch2 ) {
return false ;
@Override
public int hashCode ( ) {
int hashCode = this . hashCode ;
Elements elements = this . elements ;
if ( hashCode = = 0 & & elements . getSize ( ) ! = 0 ) {
for ( int elementIndex = 0 ; elementIndex < elements . getSize ( ) ; elementIndex + + ) {
int elementHashCode = 0 ;
boolean indexed = elements . getType ( elementIndex ) . isIndexed ( ) ;
int length = elements . getLength ( elementIndex ) ;
for ( int i = 0 ; i < length ; i + + ) {
char ch = elements . charAt ( elementIndex , i ) ;
if ( ! indexed ) {
ch = Character . toLowerCase ( ch ) ;
}
i1 + + ;
if ( ElementsParser . isAlphaNumeric ( ch ) ) {
elementHashCode = 31 * elementHashCode + ch ;
}
return true ;
}
return fals e;
hashCode = 31 * hashCode + elementHashCod e;
}
@Override
public int hashCode ( ) {
return 0 ;
}
return hashCode ;
}
@Override