private static List < Link > sortLinks ( List < Link > links ) { List < Link > result = new ArrayList < Link > ( ) ; for ( Link l : links ) { int pos = 0 ; while ( pos < result . size ( ) && l . getPos ( ) . getStart ( ) > result . get ( pos ) . getPos ( ) . getStart ( ) ) { pos ++ ; } result . add ( pos , l ) ; } return result ; }
Sorts the Links ...