Lines Matching refs:value
52 * fifty as the initial value, one could write:
54 * Integer value = new Integer(50);
58 * SpinnerNumberModel model = new SpinnerNumberModel(value, min, max, step);
71 * whenever the model's <code>value</code>, <code>stepSize</code>,
85 private Number stepSize, value;
96 * must be mutually <code>Comparable</code>, <code>value</code>
103 * If <code>value</code> or <code>stepSize</code> is <code>null</code>,
107 * Similarly if <code>(minimum <= value <= maximum</code>) is false,
110 * @param value the current (non <code>null</code>) value of the model
115 * @throws IllegalArgumentException if stepSize or value is
117 * <code>minimum <= value <= maximum</code>
119 public SpinnerNumberModel(Number value, Comparable minimum, Comparable maximum, Number stepSize) {
120 if ((value == null) || (stepSize == null)) {
121 throw new IllegalArgumentException("value and stepSize must be non-null");
123 if (!(((minimum == null) || (minimum.compareTo(value) <= 0)) &&
124 ((maximum == null) || (maximum.compareTo(value) >= 0)))) {
125 throw new IllegalArgumentException("(minimum <= value <= maximum) is false");
127 this.value = value;
136 * <code>value</code>, <code>minimum</code>/<code>maximum</code> bounds,
139 * @param value the current value of the model
144 * <code>minimum <= value <= maximum</code>
146 public SpinnerNumberModel(int value, int minimum, int maximum, int stepSize) {
147 this(Integer.valueOf(value), Integer.valueOf(minimum), Integer.valueOf(maximum), Integer.valueOf(stepSize));
153 * <code>value</code>, <code>minimum</code>/<code>maximum</code> bounds,
156 * @param value the current value of the model
161 * <code>minimum <= value <= maximum</code>
163 public SpinnerNumberModel(double value, double minimum, double maximum, double stepSize) {
164 this(new Double(value), new Double(minimum), new Double(maximum), new Double(stepSize));
170 * <code>minimum</code> or <code>maximum</code> value,
171 * <code>stepSize</code> equal to one, and an initial value of zero.
182 * the new <code>minimum</code> value may invalidate the
183 * <code>(minimum <= value <= maximum)</code>
190 * as the <code>value</code> however it's possible to use any
192 * method for a <code>Number</code> with the same type as the value.
193 * For example if value was a <code>Long</code>,
209 * the same type as <code>value</code>
225 * @return the value of the <code>minimum</code> property
237 * <code>maximum</code> value may invalidate the
238 * <code>(minimum <= value < maximum)</code>
245 * as the <code>value</code> however it's possible to use any
247 * method for a <code>Number</code> with the same type as the value.
256 * the same type as <code>value</code>
272 * @return the value of the <code>maximum</code> property
281 * Changes the size of the value change computed by the
289 * @param stepSize the size of the value change computed by the
308 * Returns the size of the value change computed by the
312 * @return the value of the <code>stepSize</code> property
323 if ((value instanceof Float) || (value instanceof Double)) {
324 double v = value.doubleValue() + (stepSize.doubleValue() * (double)dir);
325 if (value instanceof Double) {
333 long v = value.longValue() + (stepSize.longValue() * (long)dir);
335 if (value instanceof Long) {
338 else if (value instanceof Integer) {
341 else if (value instanceof Short) {
364 * @return <code>value + stepSize</code> or <code>null</code> if the sum
379 * @return <code>value - stepSize</code>, or
393 * Returns the value of the current element of the sequence.
395 * @return the value property
399 return value;
404 * Returns the value of the current element of the sequence.
406 * @return the value property
411 return value;
416 * Sets the current value for this sequence. If <code>value</code> is
419 * bounds checking is done here; the new value may invalidate the
420 * <code>(minimum <= value <= maximum)</code>
422 * the value to be something that wouldn't naturally occur in the sequence,
423 * i.e. a value that's not modulo the <code>stepSize</code>.
427 * <code>(minimum <= value <= maximum)</code> invariant is true
431 * This method fires a <code>ChangeEvent</code> if the value has changed.
433 * @param value the current (non <code>null</code>) <code>Number</code>
435 * @throws IllegalArgumentException if <code>value</code> is
441 public void setValue(Object value) {
442 if ((value == null) || !(value instanceof Number)) {
443 throw new IllegalArgumentException("illegal value");
445 if (!value.equals(this.value)) {
446 this.value = (Number)value;