public DomainArchitecture( final String da_str ) { init(); int total_length = 0; int to = -1; try { final StringTokenizer st = new StringTokenizer( da_str, DomainArchitecture.NHX_SEPARATOR ); final String length_str = ( String ) st.nextElement(); total_length = new Integer( length_str ).intValue(); while ( st.hasMoreElements() ) { final String from_str = ( String ) st.nextElement(); final String to_str = ( String ) st.nextElement(); final String support_str = ( String ) st.nextElement(); final String name = ( String ) st.nextElement(); to = new Integer( to_str ).intValue(); final int from = new Integer( from_str ).intValue(); final double support = new Double( support_str ).doubleValue(); final ProteinDomain pd = new ProteinDomain( name, from, to, support ); addDomain( pd ); } } catch ( final Exception e ) { throw new IllegalArgumentException( "malformed format for domain structure \"" + da_str + "\": " + e.getMessage() ); } if ( to > total_length ) { throw new IllegalArgumentException( "total length of domain structure is too short" ); } _total_length = total_length; }
@Override public PhylogenyData copy() { if ( getId() == null ) { return new ProteinDomain( getName(), getFrom(), getTo(), getConfidence() ); } return new ProteinDomain( getName(), getFrom(), getTo(), getId(), getConfidence() ); }
+ "\" attribute either negative or not set in: " + element ); return new ProteinDomain( name, f, t, id, conf );
final ProteinDomain pd0 = new ProteinDomain( "abc", 100, 200 ); final ProteinDomain pd1 = ( ProteinDomain ) pd0.copy(); if ( !pd1.isEqual( pd1 ) ) { final ProteinDomain pd2 = new ProteinDomain( pd0.getName(), pd0.getFrom(), pd0.getTo(), "id" ); final ProteinDomain pd3 = ( ProteinDomain ) pd2.copy(); if ( !pd3.isEqual( pd3 ) ) { final ProteinDomain d0 = new ProteinDomain( "domain0", 10, 20 ); final ProteinDomain d1 = new ProteinDomain( "domain1", 30, 40 ); final ProteinDomain d2 = new ProteinDomain( "domain2", 50, 60 ); final ProteinDomain d3 = new ProteinDomain( "domain3", 70, 80 ); final ProteinDomain d4 = new ProteinDomain( "domain4", 90, 100 ); final ArrayList<PhylogenyData> domains0 = new ArrayList<PhylogenyData>(); domains0.add( d2 );