public final class SaneOption
extends java.lang.Object
isActive()). Active options may be read (see isReadable()) and modified (see
isWriteable()).
Options have a type (see getType()), in order to read or write an option's value, you must
call the getter or setter method corresponding to the option's type. For example, for an option
of type OptionValueType.STRING, you will call setStringValue(java.lang.String) or
getStringValue().
Options may have constraints that impose restrictions on the range of values the option may take.
Constraints have a type which may be obtained using getConstraintType(). You may read the
actual constraints by calling the constraint getter method corresponding to the constraint type.
For example, an option of type OptionValueType.INT may have a constraint of type
OptionValueConstraintType.VALUE_LIST_CONSTRAINT, which you may obtain by calling
getIntegerValueListConstraint().
| Modifier and Type | Class and Description |
|---|---|
static class |
SaneOption.OptionUnits
Instances of this enum are returned by
getUnits() indicating what units, if
any, the value has. |
static class |
SaneOption.OptionWriteInfo
Represents the information that the SANE daemon returns about the effect of modifying an
option.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getBooleanValue()
Reads the current boolean value option.
|
OptionValueConstraintType |
getConstraintType() |
java.lang.String |
getDescription() |
SaneDevice |
getDevice() |
java.util.List<java.lang.Double> |
getFixedArrayValue() |
double |
getFixedValue() |
java.util.List<java.lang.Double> |
getFixedValueListConstraint() |
OptionGroup |
getGroup() |
java.util.List<java.lang.Integer> |
getIntegerArrayValue() |
int |
getIntegerValue()
Reads the current Integer value option.
|
java.util.List<java.lang.Integer> |
getIntegerValueListConstraint() |
java.lang.String |
getName() |
RangeConstraint |
getRangeConstraints() |
int |
getSize() |
java.util.List<java.lang.String> |
getStringConstraints() |
java.lang.String |
getStringValue()
Returns the value of this option interpreted as a LATIN-1 (SANE's default encoding) encoded
string.
|
java.lang.String |
getStringValue(java.nio.charset.Charset encoding) |
java.lang.String |
getTitle() |
OptionValueType |
getType() |
SaneOption.OptionUnits |
getUnits() |
int |
getValueCount() |
java.util.List<SaneWord> |
getWordConstraints() |
boolean |
isActive() |
boolean |
isConstrained()
Returns
true if this option has a constraint other than
OptionValueConstraintType.NO_CONSTRAINT. |
boolean |
isReadable() |
boolean |
isWriteable() |
boolean |
setBooleanValue(boolean value)
Sets the value of the current option to the supplied boolean value.
|
void |
setButtonValue() |
double |
setFixedValue(double value)
Sets the value of the current option to the supplied fixed-precision value.
|
java.util.List<java.lang.Double> |
setFixedValue(java.util.List<java.lang.Double> value)
Sets the value of the current option to the supplied list of fixed-precision values.
|
int |
setIntegerValue(int newValue)
Set the value of the current option to the supplied value.
|
java.util.List<java.lang.Integer> |
setIntegerValue(java.util.List<java.lang.Integer> newValue) |
java.lang.String |
setStringValue(java.lang.String newValue) |
java.lang.String |
toString() |
public SaneDevice getDevice()
public java.lang.String getName()
public java.lang.String getTitle()
public java.lang.String getDescription()
public OptionGroup getGroup()
public OptionValueType getType()
public SaneOption.OptionUnits getUnits()
public int getSize()
public int getValueCount()
public boolean isConstrained()
true if this option has a constraint other than
OptionValueConstraintType.NO_CONSTRAINT.public OptionValueConstraintType getConstraintType()
public RangeConstraint getRangeConstraints()
public java.util.List<java.lang.String> getStringConstraints()
public java.util.List<SaneWord> getWordConstraints()
public java.util.List<java.lang.Integer> getIntegerValueListConstraint()
public java.util.List<java.lang.Double> getFixedValueListConstraint()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean getBooleanValue()
throws java.io.IOException,
SaneException
OptionValueType.BOOLEAN.java.io.IOException - if a problem occurred while talking to SANESaneExceptionpublic int getIntegerValue()
throws java.io.IOException,
SaneException
java.io.IOException - if a problem occurred while talking to SANESaneExceptionpublic java.util.List<java.lang.Integer> getIntegerArrayValue()
throws java.io.IOException,
SaneException
java.io.IOExceptionSaneExceptionpublic java.lang.String getStringValue()
throws java.io.IOException,
SaneException
java.io.IOException - if a problem occurs reading the value from the SANE backendSaneExceptionpublic java.lang.String getStringValue(java.nio.charset.Charset encoding)
throws java.io.IOException,
SaneException
java.io.IOExceptionSaneExceptionpublic double getFixedValue()
throws java.io.IOException,
SaneException
java.io.IOExceptionSaneExceptionpublic java.util.List<java.lang.Double> getFixedArrayValue()
throws java.io.IOException,
SaneException
java.io.IOExceptionSaneExceptionpublic boolean setBooleanValue(boolean value)
throws java.io.IOException,
SaneException
java.io.IOExceptionSaneExceptionpublic void setButtonValue()
throws java.io.IOException,
SaneException
java.io.IOExceptionSaneExceptionpublic double setFixedValue(double value)
throws java.io.IOException,
SaneException
java.io.IOExceptionSaneExceptionpublic java.util.List<java.lang.Double> setFixedValue(java.util.List<java.lang.Double> value)
throws java.io.IOException,
SaneException
getValueCount() must be more than 1.java.io.IOExceptionSaneExceptionpublic java.lang.String setStringValue(java.lang.String newValue)
throws java.io.IOException,
SaneException
java.io.IOExceptionSaneExceptionpublic int setIntegerValue(int newValue)
throws java.io.IOException,
SaneException
newValue - for the optionjava.io.IOExceptionSaneExceptionpublic java.util.List<java.lang.Integer> setIntegerValue(java.util.List<java.lang.Integer> newValue)
throws java.io.IOException,
SaneException
java.io.IOExceptionSaneExceptionpublic boolean isActive()
public boolean isReadable()
public boolean isWriteable()