2 package org.forester.msa_compactor;
4 import org.forester.util.ForesterUtil;
6 public final class GapContribution implements Comparable<GapContribution> {
8 private final String _id;
11 GapContribution( final String id ) {
12 if ( ForesterUtil.isEmpty( id ) ) {
13 throw new IllegalArgumentException( "id is empty or null" );
19 final String getId() {
23 final double getValue() {
27 final void addToValue( final double v ) {
29 throw new IllegalArgumentException( "cannot add negative value" );
34 final void divideValue( final double d ) {
36 throw new IllegalArgumentException( "attempt to divide by non-positive value" );
42 public int compareTo( final GapContribution o ) {
43 if ( getValue() < o.getValue() ) {
46 else if ( getValue() > o.getValue() ) {