public static < E extends Comparable < E > > Interval < E > toValidInterval ( E a , E b , int flags ) { int comp = a . compareTo ( b ) ; if ( comp <= 0 ) { return new Interval ( a , b , flags ) ; } else { return new Interval ( b , a , flags ) ; } }
Create an interval with the specified endpoints reordering them as needed using the specified flags