private BasicSequence( final String identifier, final String mol_sequence, final TYPE type ) {
if ( ForesterUtil.isEmpty( identifier ) ) {
- throw new IllegalArgumentException( "identifier of sequence cannot be empty");
+ throw new IllegalArgumentException( "identifier of sequence cannot be empty" );
}
if ( ForesterUtil.isEmpty( mol_sequence ) ) {
- throw new IllegalArgumentException( "molecular sequence cannot be empty");
+ throw new IllegalArgumentException( "molecular sequence cannot be empty" );
}
_mol_sequence = mol_sequence.toCharArray();
_identifier = identifier;
// Only use if you know what you are doing!
public BasicSequence( final String identifier, final char[] mol_sequence, final TYPE type ) {
if ( ForesterUtil.isEmpty( identifier ) ) {
- throw new IllegalArgumentException( "identifier of sequence cannot be empty");
+ throw new IllegalArgumentException( "identifier of sequence cannot be empty" );
}
- if ( mol_sequence == null || mol_sequence.length < 1 ) {
- throw new IllegalArgumentException( "molecular sequence cannot be empty");
+ if ( ( mol_sequence == null ) || ( mol_sequence.length < 1 ) ) {
+ throw new IllegalArgumentException( "molecular sequence cannot be empty" );
}
_mol_sequence = mol_sequence;
_identifier = identifier;
}
@Override
- public boolean equals(Object obj) {
- if (obj == null) {
+ public boolean equals( final Object obj ) {
+ if ( obj == null ) {
return false;
}
- if (obj.getClass() != getClass()) {
+ if ( obj.getClass() != getClass() ) {
return false;
}
- Sequence other = ( Sequence) obj;
- if ( getMolecularSequenceAsString() .equals( other.getMolecularSequenceAsString() )) {
+ final Sequence other = ( Sequence ) obj;
+ if ( getMolecularSequenceAsString().equals( other.getMolecularSequenceAsString() ) ) {
return true;
}
return false;
}
-
+
@Override
public int hashCode() {
return getMolecularSequenceAsString().hashCode();
}
-
-
+
@Override
public String toString() {
final StringBuffer sb = new StringBuffer();
@Override
public String getMolecularSequenceAsString() {
-
return new String( getMolecularSequence() );
}
}