+ @Override
+ public int compareTo( final Sequence o ) {
+ if ( ( !ForesterUtil.isEmpty( getName() ) ) && ( !ForesterUtil.isEmpty( o.getName() ) ) ) {
+ return getName().compareTo( o.getName() );
+ }
+ if ( ( !ForesterUtil.isEmpty( getSymbol() ) ) && ( !ForesterUtil.isEmpty( o.getSymbol() ) ) ) {
+ return getSymbol().compareTo( o.getSymbol() );
+ }
+ if ( ( !ForesterUtil.isEmpty( getGeneName() ) ) && ( !ForesterUtil.isEmpty( o.getGeneName() ) ) ) {
+ return getGeneName().compareTo( o.getGeneName() );
+ }
+ if ( ( getAccession() != null ) && ( o.getAccession() != null )
+ && !ForesterUtil.isEmpty( getAccession().getValue() )
+ && !ForesterUtil.isEmpty( o.getAccession().getValue() ) ) {
+ return getAccession().getValue().compareTo( o.getAccession().getValue() );
+ }
+ if ( ( !ForesterUtil.isEmpty( getMolecularSequence() ) )
+ && ( !ForesterUtil.isEmpty( o.getMolecularSequence() ) ) ) {
+ return getMolecularSequence().compareTo( o.getMolecularSequence() );
+ }
+ return 0;
+ }
+