public int compare(Object o1,
Object o2) {
RuleTerminalNode r1 = (RuleTerminalNode) o1;
RuleTerminalNode r2 = (RuleTerminalNode) o2;
Salience so1 = r1.getRule().getSalience();
if ( so1 != null && !(so1 instanceof SalienceInteger) ) {
throw new RuntimeException( r1.getRule().getName() + "must not have a dynamic salience" );
}
Salience so2 = r2.getRule().getSalience();
if ( so2 != null && !(so2 instanceof SalienceInteger) ) {
throw new RuntimeException( r2.getRule().getName() + "must not have a dynamic salience" );
}
int s1 = so1.getValue( null,
null,
null );
int s2 = so2.getValue( null,
null,
null );
if ( s1 > s2 ) {
return -1;