X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Forg%2Fbiojava%2Fdasobert%2Fdas2%2FDas2CapabilityImpl.java;h=5a061c776c4505a45de3eb2bf3bfa1066b13c07d;hb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;hp=273defa31f1f63f499568482af00f727fc98e1ac;hpb=dd74fc4938723fe5ec48d4e5fdcfbe58ac42a48d;p=jalview.git diff --git a/src/org/biojava/dasobert/das2/Das2CapabilityImpl.java b/src/org/biojava/dasobert/das2/Das2CapabilityImpl.java index 273defa..5a061c7 100755 --- a/src/org/biojava/dasobert/das2/Das2CapabilityImpl.java +++ b/src/org/biojava/dasobert/das2/Das2CapabilityImpl.java @@ -16,94 +16,115 @@ * 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; + + } }