formatting
[jalview.git] / src / jalview / ws / rest / params / SeqVector.java
index 7632067..f890add 100644 (file)
@@ -37,24 +37,30 @@ import org.apache.http.entity.mime.content.StringBody;
 import org.jmol.util.ArrayUtil;
 
 /**
- * input a list of sequences separated by some separator 
+ * input a list of sequences separated by some separator
+ * 
  * @author JimP
- *
+ * 
  */
-public class SeqVector extends InputType {
+public class SeqVector extends InputType
+{
   String sep;
+
   molType type;
+
   public SeqVector()
   {
-    super(new Class[] { AlignmentI.class} );
+    super(new Class[]
+    { AlignmentI.class });
   }
 
   @Override
-  public ContentBody formatForInput(RestJob rj) throws UnsupportedEncodingException, NoValidInputDataException
+  public ContentBody formatForInput(RestJob rj)
+          throws UnsupportedEncodingException, NoValidInputDataException
   {
     StringBuffer idvector = new StringBuffer();
-    boolean list=false;
-    for (SequenceI seq:rj.getSequencesForInput(token, type))
+    boolean list = false;
+    for (SequenceI seq : rj.getSequencesForInput(token, type))
     {
       if (list)
       {
@@ -64,15 +70,16 @@ public class SeqVector extends InputType {
     }
     return new StringBody(idvector.toString());
   }
+
   @Override
   public List<String> getURLEncodedParameter()
   {
     ArrayList<String> prms = new ArrayList<String>();
     super.addBaseParams(prms);
-    prms.add("sep='"+ sep+"'");
-    if (type!=null)
+    prms.add("sep='" + sep + "'");
+    if (type != null)
     {
-      prms.add("type='"+type+"'");
+      prms.add("type='" + type + "'");
     }
     return prms;
   }
@@ -90,20 +97,22 @@ public class SeqVector extends InputType {
 
     if (tok.startsWith("sep"))
     {
-      sep=val;
+      sep = val;
       return true;
     }
     if (tok.startsWith("type"))
     {
-      try {
-        type=molType.valueOf(val);
+      try
+      {
+        type = molType.valueOf(val);
         return true;
       } catch (Exception x)
       {
-        warnings.append("Invalid molecule type '"+val+"'. Must be one of (");
-        for (molType v:molType.values())
+        warnings.append("Invalid molecule type '" + val
+                + "'. Must be one of (");
+        for (molType v : molType.values())
         {
-          warnings.append(" "+v);
+          warnings.append(" " + v);
         }
         warnings.append(")\n");
       }
@@ -121,7 +130,7 @@ public class SeqVector extends InputType {
             { " ", ",", ";", "\t", "|" }), null));
     lst.add(createMolTypeOption("type", "Sequence type", false, type,
             molType.MIX));
-    
+
     return lst;
   }