@Test public void testCompareTo() { assertCompare( 0, Float.NaN, Float.NaN ); assertCompare( 0, 0, 0 ); assertCompare( 1, 0, 1 ); assertCompare( 1, 2, Float.POSITIVE_INFINITY ); assertCompare( 1, Float.NEGATIVE_INFINITY, -3 ); assertCompare( 1, Float.NaN, 0 ); assertCompare( 1, Float.NaN, -1 ); assertCompare( 1, Float.NaN, Float.NEGATIVE_INFINITY ); assertCompare( 1, Float.NaN, Float.POSITIVE_INFINITY ); assertCompare( -1, Float.NaN, 0, 1 ); assertCompare( -1, 10, 0, 1 ); }
public int compareTo( PrioritizedComponent<?> o ) { int rel = ( isDisabled() ? 1 : 0 ) - ( o.isDisabled() ? 1 : 0 ); if ( rel == 0 ) { rel = Float.compare( o.priority, priority ); if ( rel == 0 ) { rel = index - o.index; } } return rel; }
PrioritizedComponent implements Comparable<PrioritizedComponent<?>> { public int compareTo( PrioritizedComponent<?> o ) { int rel = ( isDisabled() ? 1 : 0 ) - ( o.isDisabled() ? 1 : 0 ); if ( rel == 0 ) { rel = Float.compare( o.priority, priority ); if ( rel == 0 ) { rel = index - o.index; } } return rel; } }
PrioritizedComponent implements Comparable<PrioritizedComponent<?>> { public int compareTo( PrioritizedComponent<?> o ) { int rel = ( isDisabled() ? 1 : 0 ) - ( o.isDisabled() ? 1 : 0 ); if ( rel == 0 ) { rel = Float.compare( o.priority, priority ); if ( rel == 0 ) { rel = index - o.index; } } return rel; } PrioritizedComponent( T component, Class<?> type, float priority, int index ); }
PrioritizedComponent implements Comparable<PrioritizedComponent<?>> { public int compareTo( PrioritizedComponent<?> o ) { int rel = ( isDisabled() ? 1 : 0 ) - ( o.isDisabled() ? 1 : 0 ); if ( rel == 0 ) { rel = Float.compare( o.priority, priority ); if ( rel == 0 ) { rel = index - o.index; } } return rel; } PrioritizedComponent( T component, Class<?> type, float priority, int index ); T getComponent(); Class<?> getType(); float getPriority(); boolean isDisabled(); int compareTo( PrioritizedComponent<?> o ); @Override String toString(); }
PrioritizedComponent implements Comparable<PrioritizedComponent<?>> { public int compareTo( PrioritizedComponent<?> o ) { int rel = ( isDisabled() ? 1 : 0 ) - ( o.isDisabled() ? 1 : 0 ); if ( rel == 0 ) { rel = Float.compare( o.priority, priority ); if ( rel == 0 ) { rel = index - o.index; } } return rel; } PrioritizedComponent( T component, Class<?> type, float priority, int index ); T getComponent(); Class<?> getType(); float getPriority(); boolean isDisabled(); int compareTo( PrioritizedComponent<?> o ); @Override String toString();  }