// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
package org.forester.io.parsers.phyloxml.data;
import java.util.HashMap;
import java.util.Map;
+import org.forester.io.parsers.phyloxml.PhyloXmlDataFormatException;
import org.forester.io.parsers.phyloxml.PhyloXmlHandler;
import org.forester.io.parsers.phyloxml.PhyloXmlMapping;
import org.forester.io.parsers.phyloxml.XmlElement;
-import org.forester.io.parsers.util.PhylogenyParserException;
import org.forester.phylogeny.Phylogeny;
import org.forester.phylogeny.data.Confidence;
import org.forester.phylogeny.data.Sequence;
}
@Override
- public SequenceRelation parse( final XmlElement element ) throws PhylogenyParserException {
+ public SequenceRelation parse( final XmlElement element ) throws PhyloXmlDataFormatException {
final SequenceRelation seqRelation = new SequenceRelation();
if ( element.isHasAttribute( PhyloXmlMapping.SEQUENCE_RELATION_TYPE ) ) {
final String sType = element.getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_TYPE );
seqRelation.setType( SequenceRelation.SEQUENCE_RELATION_TYPE.valueOf( sType ) );
}
if ( element.isHasAttribute( PhyloXmlMapping.SEQUENCE_RELATION_ID_REF0 ) && ( _phylogeny != null ) ) {
- final Sequence ref = PhyloXmlHandler.getSequenceMapByIdForPhylogeny( _phylogeny ).get( element
- .getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_ID_REF0 ) );
+ final Sequence ref = PhyloXmlHandler.getSequenceMapByIdForPhylogeny( _phylogeny )
+ .get( element.getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_ID_REF0 ) );
if ( ref != null ) {
seqRelation.setRef0( ref );
}
}
if ( element.isHasAttribute( PhyloXmlMapping.SEQUENCE_RELATION_ID_REF1 ) && ( _phylogeny != null ) ) {
- final Sequence ref = PhyloXmlHandler.getSequenceMapByIdForPhylogeny( _phylogeny ).get( element
- .getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_ID_REF1 ) );
+ final Sequence ref = PhyloXmlHandler.getSequenceMapByIdForPhylogeny( _phylogeny )
+ .get( element.getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_ID_REF1 ) );
if ( ref != null ) {
seqRelation.setRef1( ref );
}
}
if ( element.isHasAttribute( PhyloXmlMapping.SEQUENCE_RELATION_DISTANCE ) ) {
- seqRelation.setDistance( Double
- .valueOf( element.getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_DISTANCE ) ) );
+ seqRelation
+ .setDistance( Double.valueOf( element.getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_DISTANCE ) ) );
}
for( int i = 0; i < element.getNumberOfChildElements(); ++i ) {
final XmlElement child_element = element.getChildElement( i );