2 * BioJava development code
4 * This code may be freely distributed and modified under the
5 * terms of the GNU Lesser General Public Licence. This should
6 * be distributed with the code. If you do not have a copy,
9 * http://www.gnu.org/copyleft/lesser.html
11 * Copyright for this code is held jointly by the individual
12 * authors. These should be listed in @author doc comments.
14 * For more information on the BioJava project and its aims,
15 * or to join the biojava-l mailing list, visit the home page
18 * http://www.biojava.org/
20 * Created on Feb 9, 2006
23 package org.biojava.dasobert.das2;
25 public class Das2CapabilityImpl
26 implements Das2Capability{
32 public static String DAS1_CAPABILITY_PREFIX = "das1:";
34 public Das2CapabilityImpl() {
38 formats = new String[0];
42 public boolean isDas1Style(){
44 if ( capability == null)
46 if ( capability.length() < DAS1_CAPABILITY_PREFIX.length())
48 if ( capability.substring(0,DAS1_CAPABILITY_PREFIX.length()).equals(DAS1_CAPABILITY_PREFIX))
54 public boolean equals(Das2Capability other){
56 boolean status = true;
58 if (! capability.equals(other.getCapability()))
60 if ( ! queryId.equals(other.getQueryUri()))
66 public int hashCode(){
68 h = 31 * h + ( null == capability ? 0 : capability.hashCode()) ;
69 h = 31 * h + ( null == queryId ? 0 : queryId.hashCode()) ;
74 public String toString(){
75 String txt ="capability " + capability + " queryId " + queryId;
79 public String getCapability() {
84 public String[] getFormats() {
88 public String getQueryUri() {
92 public void setCapability(String type) {
97 public void setFormats(String[] formats) {
99 this.formats = formats;
102 public void setQueryUri(String id) {