private Long [ ] checkLocation ( Location location ) { Long [ ] positions = new Long [ 2 ] ; if ( location . isComplement ( ) ) { positions [ 0 ] = location . getEndPosition ( ) ; positions [ 1 ] = location . getBeginPosition ( ) ; } else { positions [ 0 ] = location . getBeginPosition ( ) ; positions [ 1 ] = location . getEndPosition ( ) ; } return positions ; }
Checks and swaps positions if in wrong order .