X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fparams%2Fsimple%2FIntegerParameter.java;h=b3a01b28ca120534412a7bd0bb8de2f993d18bb2;hb=7f68870deed3116cee84b6fa5e637dde3957a3b2;hp=1373723bc2943b9954c782e975847684671cb4dc;hpb=b57a02c25e335d033c97f8a6bacd6b54f62bd2b6;p=jalview.git diff --git a/src/jalview/ws/params/simple/IntegerParameter.java b/src/jalview/ws/params/simple/IntegerParameter.java index 1373723..b3a01b2 100644 --- a/src/jalview/ws/params/simple/IntegerParameter.java +++ b/src/jalview/ws/params/simple/IntegerParameter.java @@ -1,30 +1,28 @@ -/******************************************************************************* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) - * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, 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.ParameterI; import jalview.ws.params.ValueConstrainI; -import compbio.metadata.ValueConstrain.Type; - /** * @author jimp * @@ -33,8 +31,11 @@ public class IntegerParameter extends Option implements ParameterI { int defval; - int min, max; + int min; + + int max; + @Override public ValueConstrainI getValidValue() { return new ValueConstrainI() @@ -49,27 +50,13 @@ public class IntegerParameter extends Option implements ParameterI @Override public Number getMin() { - if (min < max) - { - return min; - } - else - { - return null; - } + return min < max ? min : null; } @Override public Number getMax() { - if (min < max) - { - return max; - } - else - { - return null; - } + return min < max ? max : null; } }; } @@ -81,21 +68,21 @@ public class IntegerParameter extends Option implements ParameterI min = parm.min; } - public IntegerParameter(String name, String description, - boolean required, int defValue, int min, int max) + public IntegerParameter(String name, String description, boolean required, + int defValue, int min, int max) { - super(name, description, required, String.valueOf(defValue), null, - null, null); + super(name, description, required, String.valueOf(defValue), null, null, + null); defval = defValue; this.min = min; this.max = max; } - public IntegerParameter(String name, String description, - boolean required, int defValue, int value, int min, int max) + public IntegerParameter(String name, String description, boolean required, + int defValue, int value, int min, int max) { - super(name, description, required, String.valueOf(defValue), String - .valueOf(value), null, null); + super(name, description, required, String.valueOf(defValue), + String.valueOf(value), null, null); defval = defValue; this.min = min; this.max = max;