X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fparams%2Fsimple%2FIntegerParameter.java;h=b3a01b28ca120534412a7bd0bb8de2f993d18bb2;hb=7f68870deed3116cee84b6fa5e637dde3957a3b2;hp=94a054b4928ebb99fca683dac07e55bc8ec73778;hpb=b2f9a8d7bce642ff4011bc6d49e02bb0569fbb11;p=jalview.git diff --git a/src/jalview/ws/params/simple/IntegerParameter.java b/src/jalview/ws/params/simple/IntegerParameter.java index 94a054b..b3a01b2 100644 --- a/src/jalview/ws/params/simple/IntegerParameter.java +++ b/src/jalview/ws/params/simple/IntegerParameter.java @@ -1,19 +1,21 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1) - * Copyright (C) 2014 The Jalview Authors + * 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; @@ -29,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() @@ -45,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; } }; } @@ -77,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;