public int compareTo ( final OCompositeKey otherKey ) { final Iterator < Object > inIter = keys . iterator ( ) ; final Iterator < Object > outIter = otherKey . keys . iterator ( ) ; while ( inIter . hasNext ( ) && outIter . hasNext ( ) ) { final Object inKey = inIter . next ( ) ; final Object outKey = outIter . next ( ) ; if ( outKey instanceof OAlwaysGreaterKey ) return - 1 ; if ( outKey instanceof OAlwaysLessKey ) return 1 ; final int result = comparator . compare ( inKey , outKey ) ; if ( result != 0 ) return result ; } return 0 ; }
Performs partial comparison of two composite keys .