X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fparams%2Fsimple%2FOption.java;h=653359f3d11ec226855361f795f9620800ba9afe;hb=fda3adcb9abc603b03188404f532a5bc8097dd55;hp=4efeaeb9891adaf9abb2b5f73b4dd44ec50ddad9;hpb=a45774ee31d9f35d4eff46d54d7deab719afb092;p=jalview.git diff --git a/src/jalview/ws/params/simple/Option.java b/src/jalview/ws/params/simple/Option.java index 4efeaeb..653359f 100644 --- a/src/jalview/ws/params/simple/Option.java +++ b/src/jalview/ws/params/simple/Option.java @@ -1,20 +1,23 @@ -/******************************************************************************* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) - * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle - * +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * * This file is part of Jalview. - * + * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - * + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with Jalview. If not, see . - *******************************************************************************/ + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.ws.params.simple; import jalview.ws.params.OptionI; @@ -24,13 +27,17 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -public class Option implements OptionI { +public class Option implements OptionI +{ + + String name, value, defvalue, description; + + ArrayList possibleVals = new ArrayList(); - - String name, value, defvalue,description; - ArrayList possibleVals=new ArrayList(); boolean required; + URL fdetails; + @Override public String getName() { @@ -40,7 +47,7 @@ public class Option implements OptionI { @Override public String getValue() { - return value==null ? defvalue : value; + return value == null ? defvalue : value; } @Override @@ -72,35 +79,39 @@ public class Option implements OptionI { { return possibleVals; } + public Option(Option opt) { name = new String(opt.name); - if (opt.value!=null) + if (opt.value != null) value = new String(opt.value); - if (opt.defvalue!=null) - defvalue=new String(opt.defvalue); - if (opt.description!=null) - description=new String(opt.description); - if (opt.possibleVals!=null) { - possibleVals = (ArrayList)opt.possibleVals.clone(); + if (opt.defvalue != null) + defvalue = new String(opt.defvalue); + if (opt.description != null) + description = new String(opt.description); + if (opt.possibleVals != null) + { + possibleVals = (ArrayList) opt.possibleVals.clone(); } required = opt.required; // URLs are singletons - so we copy by reference. nasty but true. fdetails = opt.fdetails; } + public Option() { } public Option(String name2, String description2, boolean isrequired, - String defValue, String value, Collection possibleVals, URL fdetails) + String defValue, String value, Collection possibleVals, + URL fdetails) { name = name2; description = description2; this.value = value; this.required = isrequired; this.defvalue = defValue; - if (possibleVals!=null) + if (possibleVals != null) { this.possibleVals = new ArrayList(); this.possibleVals.addAll(possibleVals); @@ -108,11 +119,10 @@ public class Option implements OptionI { this.fdetails = fdetails; } - @Override public OptionI copy() { Option opt = new Option(this); return opt; } -} \ No newline at end of file +}