/* * BioJava development code * * This code may be freely distributed and modified under the * terms of the GNU Lesser General Public Licence. This should * be distributed with the code. If you do not have a copy, * see: * * http://www.gnu.org/copyleft/lesser.html * * Copyright for this code is held jointly by the individual * authors. These should be listed in @author doc comments. * * For more information on the BioJava project and its aims, * or to join the biojava-l mailing list, visit the home page * 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; public class Das2SourceImpl extends Das1Source implements Das2Source { Das2Capability[] capabilities; public Das2SourceImpl() { super(); capabilities = new Das2Capability[0]; } /** 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