private List < Integer > alternatesToHash ( List < AlternateCoordinate > alternates ) { List < Integer > list = new ArrayList <> ( alternates . size ( ) ) ; for ( AlternateCoordinate a : alternates ) { // list.add(Objects.hash(a.getChromosome(), a.getStart(), a.getEnd(), a.getReference(), a.getAlternate(), a.getType())); int result = 1 ; result = 31 * result + a . getChromosome ( ) . hashCode ( ) ; result = 31 * result + a . getStart ( ) . hashCode ( ) ; result = 31 * result + a . getEnd ( ) . hashCode ( ) ; result = 31 * result + a . getReference ( ) . hashCode ( ) ; result = 31 * result + a . getAlternate ( ) . hashCode ( ) ; result = 31 * result + a . getType ( ) . hashCode ( ) ; list . add ( result ) ; } return list ; }
Create a list of alternates as Integers to speed up the creation of the VariantAlternateRearranger .