X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Forg%2Fbiojava%2Fdasobert%2Fdas2%2FDas2CapabilityImpl.java;h=196b68190093a886d65d5b4fa4e56c459633fe4f;hb=bedaaf827545d4e425c98ada89a9dfbff6fc055b;hp=273defa31f1f63f499568482af00f727fc98e1ac;hpb=714ad67911cdd8e2078cd3e961b5d709f5f0e5ce;p=jalview.git diff --git a/src/org/biojava/dasobert/das2/Das2CapabilityImpl.java b/src/org/biojava/dasobert/das2/Das2CapabilityImpl.java index 273defa..196b681 100755 --- a/src/org/biojava/dasobert/das2/Das2CapabilityImpl.java +++ b/src/org/biojava/dasobert/das2/Das2CapabilityImpl.java @@ -16,94 +16,116 @@ * at: * * http://www.biojava.org/ - * + * * Created on Feb 9, 2006 * */ package org.biojava.dasobert.das2; -public class Das2CapabilityImpl -implements Das2Capability{ - - String capability; - String[] formats; - String queryId; - - public static String DAS1_CAPABILITY_PREFIX = "das1:"; - - public Das2CapabilityImpl() { - super(); - capability = "undef"; - queryId = ""; - formats = new String[0]; +public class Das2CapabilityImpl implements Das2Capability +{ + + String capability; + + String[] formats; + + String queryId; + + public static String DAS1_CAPABILITY_PREFIX = "das1:"; + + public Das2CapabilityImpl() + { + super(); + capability = "undef"; + queryId = ""; + formats = new String[0]; + + } + public boolean isDas1Style() + { + + if (capability == null) + { + return false; } - - public boolean isDas1Style(){ - - if ( capability == null) - return false; - if ( capability.length() < DAS1_CAPABILITY_PREFIX.length()) - return false; - if ( capability.substring(0,DAS1_CAPABILITY_PREFIX.length()).equals(DAS1_CAPABILITY_PREFIX)) - return true; - return false; - + if (capability.length() < DAS1_CAPABILITY_PREFIX.length()) + { + return false; } - - public boolean equals(Das2Capability other){ - - boolean status = true; - - if (! capability.equals(other.getCapability())) - status = false; - if ( ! queryId.equals(other.getQueryUri())) - status = false; - - return status; + if (capability.substring(0, DAS1_CAPABILITY_PREFIX.length()).equals( + DAS1_CAPABILITY_PREFIX)) + { + return true; } - - public int hashCode(){ - int h = 7; - h = 31 * h + ( null == capability ? 0 : capability.hashCode()) ; - h = 31 * h + ( null == queryId ? 0 : queryId.hashCode()) ; - - return h; + return false; + + } + + public boolean equals(Das2Capability other) + { + + boolean status = true; + + if (!capability.equals(other.getCapability())) + { + status = false; } - - public String toString(){ - String txt ="capability " + capability + " queryId " + queryId; - return txt; + if (!queryId.equals(other.getQueryUri())) + { + status = false; } - public String getCapability() { - - return capability; - } + return status; + } - public String[] getFormats() { - return formats; - } + public int hashCode() + { + int h = 7; + h = 31 * h + (null == capability ? 0 : capability.hashCode()); + h = 31 * h + (null == queryId ? 0 : queryId.hashCode()); - public String getQueryUri() { - return queryId; - } + return h; + } - public void setCapability(String type) { - capability = type; - - } + public String toString() + { + String txt = "capability " + capability + " queryId " + queryId; + return txt; + } - public void setFormats(String[] formats) { - - this.formats = formats; - } + public String getCapability() + { - public void setQueryUri(String id) { - queryId = id; - - } - - + return capability; + } + + public String[] getFormats() + { + return formats; + } + + public String getQueryUri() + { + return queryId; + } + + public void setCapability(String type) + { + capability = type; + + } + + public void setFormats(String[] formats) + { + + this.formats = formats; + } + + public void setQueryUri(String id) + { + queryId = id; + + } }