X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Forg%2Fbiojava%2Fdasobert%2Fdas2%2FDas2SourceImpl.java;h=2f5a7ed557924690b50c46411909a774f33eb151;hb=bedaaf827545d4e425c98ada89a9dfbff6fc055b;hp=aca49b227befafb0b766408b7d81e4899ba09536;hpb=ac8acb905e84708b759ae1e87eaf6691d9376d57;p=jalview.git diff --git a/src/org/biojava/dasobert/das2/Das2SourceImpl.java b/src/org/biojava/dasobert/das2/Das2SourceImpl.java index aca49b2..2f5a7ed 100755 --- a/src/org/biojava/dasobert/das2/Das2SourceImpl.java +++ b/src/org/biojava/dasobert/das2/Das2SourceImpl.java @@ -16,129 +16,142 @@ * at: * * http://www.biojava.org/ - * + * * Created on Feb 9, 2006 * */ package org.biojava.dasobert.das2; -import org.biojava.dasobert.dasregistry.Das1Source; -import org.biojava.dasobert.dasregistry.DasSource; +import org.biojava.dasobert.dasregistry.*; -public class Das2SourceImpl -extends Das1Source -implements Das2Source +public class Das2SourceImpl extends Das1Source implements Das2Source { - Das2Capability[] capabilities; - - public Das2SourceImpl() { - super(); + Das2Capability[] capabilities; + + public Das2SourceImpl() + { + super(); + + capabilities = new Das2Capability[0]; + } + + /** + * compare if two DasSources are identical + * + */ + public boolean equals(DasSource other) + { - capabilities = new Das2Capability[0]; + if (this == other) + { + return true; } - - - /** compare if two DasSources are identical - * - */ - public boolean equals(DasSource other){ - - if ( this == other) - return true; - - if ( ( other == null) || (other.getClass() != this.getClass())) - return false; - - // to compare if two Das2Sources are identical we do the following: - // we check the capabilities - - Das2SourceImpl d2o = (Das2SourceImpl)other; - - if ( nickname.equals(d2o.getNickname())) - return true; - - Das2Capability[] othercaps = d2o.getDas2Capabilities(); - - if ( ! (capabilities.length == othercaps.length)) - return false; - - for ( int x=0;x