public class LengthInInchFieldValue extends java.lang.Object implements FieldValue
Item.getLengthInInchValue(com.canto.cumulus.GUID)
to get this wrapper class object. You can then use Item.setLengthInInchValue(com.canto.cumulus.GUID, LengthInInchFieldValue)
to set the field value back into the item.Constructor and Description |
---|
LengthInInchFieldValue()
Create a new empty length field value.
|
LengthInInchFieldValue(CumulusSession cumulusSession)
Create a new empty length field value which uses the measurement unit from the user of the given session.
|
LengthInInchFieldValue(CumulusSession cumulusSession,
double coreValue)
Create a new length field value from the given core field value which uses the measurement unit from the user of the given session.
|
LengthInInchFieldValue(double coreValue)
Create a new length field value from the given core field value.
|
LengthInInchFieldValue(double coreValue,
int maximumFractionDigits)
Create a new length field value from the given core field value.
|
LengthInInchFieldValue(int maximumFractionDigits)
Create a new empty length field value.
|
Modifier and Type | Method and Description |
---|---|
void |
clearValue()
Clear the field's value.
|
boolean |
equals(java.lang.Object o) |
double |
getCoreValue()
Get the core double value for this length field value.
|
java.lang.String |
getDisplayString()
Get a string of this field value to be displayed to the user.
|
java.lang.String |
getDisplayString(java.util.Locale locale)
Get a string of this field value to be displayed to the user.
|
java.lang.String |
getDisplayString(java.util.Locale locale,
int maximumFractionDigits)
Get a string of this field value to be displayed to the user.
|
java.lang.String |
getDisplayString(java.util.Locale locale,
int maximumFractionDigits,
MeasurementUnit measurementUnit)
Get a string of this field value to be displayed to the user.
|
java.lang.String |
getDisplayString(java.util.Locale locale,
MeasurementUnit measurementUnit)
Get a string of this field value to be displayed to the user.
|
int |
getMaximumFractionDigits()
Returns the maximum number of fraction digits to use when creating a display string.
|
int |
hashCode() |
boolean |
hasValue()
Return whether this field has a value.
|
void |
setCoreValue(double value)
Set the value from a core double value in inches.
|
void |
setFromDisplayString(java.util.Locale locale,
MeasurementUnit measurementUnit,
java.lang.String value)
Set the field value from a display string using a specific locale for formatting and language selection.
|
void |
setFromDisplayString(java.util.Locale locale,
java.lang.String value)
Set the field value from a display string using a specific locale for formatting and language selection.
|
void |
setFromDisplayString(java.lang.String value)
Set the field value from a display string.
|
void |
setMaximumFractionDigits(int maximumFractionDigits)
Configures the maximum number of fraction digits to use when creating a display string.
|
java.lang.String |
toString()
Same as
getDisplayString() . |
public LengthInInchFieldValue()
public LengthInInchFieldValue(int maximumFractionDigits)
public LengthInInchFieldValue(CumulusSession cumulusSession)
cumulusSession
- session of the user whose measurement unit should be usedpublic LengthInInchFieldValue(double coreValue)
Item.getLengthInInchValue(com.canto.cumulus.GUID)
to get a field value transfers
this information to the field value wrapper.coreValue
- The double field value as it comes from the item.public LengthInInchFieldValue(double coreValue, int maximumFractionDigits)
Item.getLengthInInchValue(com.canto.cumulus.GUID)
to get a field value transfers
this information to the field value wrapper. Configures the default maximum number of fraction digits in case no number of fraction digits is specified.coreValue
- The double field value as it comes from the item.public LengthInInchFieldValue(CumulusSession cumulusSession, double coreValue)
cumulusSession
- session of the user whose measurement unit should be usedcoreValue
- The double field value as it comes from the item.public boolean hasValue()
hasValue
in interface FieldValue
true
if the field has a value, false
otherwise.public void clearValue()
Item.save()
to
save this change back to the catalog.clearValue
in interface FieldValue
public java.lang.String getDisplayString()
getDisplayString
in interface FieldValue
public java.lang.String getDisplayString(java.util.Locale locale)
getDisplayString
in interface FieldValue
locale
- The locale to use for formatting and language selection.public java.lang.String getDisplayString(java.util.Locale locale, int maximumFractionDigits)
locale
- The locale to use for formatting and language selection.maximumFractionDigits
- maximum number of fractions digits to usepublic java.lang.String getDisplayString(java.util.Locale locale, MeasurementUnit measurementUnit)
locale
- The locale to use for formatting and language selection.measurementUnit
- the measurement unit to usepublic java.lang.String getDisplayString(java.util.Locale locale, int maximumFractionDigits, MeasurementUnit measurementUnit)
locale
- The locale to use for formatting and language selection.maximumFractionDigits
- maximum number of fractions digits to usemeasurementUnit
- the measurement unit to usepublic void setFromDisplayString(java.lang.String value) throws InvalidArgumentException
Item.save()
to save this change back to the catalog. This method uses the current locale for formatting and language selection.setFromDisplayString
in interface FieldValue
value
- The display string to set the value from.InvalidArgumentException
- if the display string is not of the right format.public void setFromDisplayString(java.util.Locale locale, java.lang.String value) throws InvalidArgumentException
Item.save()
to save this change back to the catalog.setFromDisplayString
in interface FieldValue
locale
- The locale to use for formatting and language selection.value
- The display string to set the value from.InvalidArgumentException
- if the display string is not of the right format.public void setFromDisplayString(java.util.Locale locale, MeasurementUnit measurementUnit, java.lang.String value) throws InvalidArgumentException
Item.save()
to save this change back to the catalog.locale
- The locale to use for formatting and language selection.measurementUnit
- unit to use for the given valuevalue
- The display string to set the value from.InvalidArgumentException
- if the display string is not of the right format.public double getCoreValue()
public void setCoreValue(double value)
Item.save()
to save this change back to the catalog.value
- The core value in inches to be used.public int getMaximumFractionDigits()
public void setMaximumFractionDigits(int maximumFractionDigits)
maximumFractionDigits
- maximum number of fraction digits to usepublic java.lang.String toString()
getDisplayString()
.toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
www.canto.com
Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto GmbH, registered in the U.S. and other countries.