1/*
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package javax.accessibility;
27
28/**
29 * The {@code AccessibleValue} interface should be supported by any object that
30 * supports a numerical value (e.g., a scroll bar). This interface provides the
31 * standard mechanism for an assistive technology to determine and set the
32 * numerical value as well as get the minimum and maximum values. Applications
33 * can determine if an object supports the {@code AccessibleValue} interface by
34 * first obtaining its {@code AccessibleContext} (see {@link Accessible}) and
35 * then calling the {@link AccessibleContext#getAccessibleValue} method. If the
36 * return value is not {@code null}, the object supports this interface.
37 *
38 * @author Peter Korn
39 * @author Hans Muller
40 * @author Willie Walker
41 * @see Accessible
42 * @see Accessible#getAccessibleContext
43 * @see AccessibleContext
44 * @see AccessibleContext#getAccessibleValue
45 */
46public interface AccessibleValue {
47
48    /**
49     * Get the value of this object as a {@code Number}. If the value has not
50     * been set, the return value will be {@code null}.
51     *
52     * @return value of the object
53     * @see #setCurrentAccessibleValue
54     */
55    public Number getCurrentAccessibleValue();
56
57    /**
58     * Set the value of this object as a {@code Number}.
59     *
60     * @param  n the number to use for the value
61     * @return {@code true} if the value was set; else {@code false}
62     * @see #getCurrentAccessibleValue
63     */
64    public boolean setCurrentAccessibleValue(Number n);
65
66    // /**
67    // * Get the description of the value of this object.
68    // *
69    // * @return description of the value of the object
70    // */
71    // public String getAccessibleValueDescription();
72
73    /**
74     * Get the minimum value of this object as a {@code Number}.
75     *
76     * @return minimum value of the object; {@code null} if this object does not
77     *         have a minimum value
78     * @see #getMaximumAccessibleValue
79     */
80    public Number getMinimumAccessibleValue();
81
82    /**
83     * Get the maximum value of this object as a {@code Number}.
84     *
85     * @return maximum value of the object; {@code null} if this object does not
86     *         have a maximum value
87     * @see #getMinimumAccessibleValue
88     */
89    public Number getMaximumAccessibleValue();
90}
91