public class ResolutionFieldValue extends java.lang.Object implements FieldValue
Item.getResolutionValue(com.canto.cumulus.GUID)
to get this wrapper class object. You can then use Item.setResolutionValue(com.canto.cumulus.GUID, ResolutionFieldValue)
to set the field value back into the item.Constructor and Description |
---|
ResolutionFieldValue()
Create a new empty resolution field value.
|
ResolutionFieldValue(double coreValue)
Create a new resolution field value from the given core field value.
|
ResolutionFieldValue(double coreValue,
int maximumFractionDigits)
Create a new resolution field value from the given core field value.
|
ResolutionFieldValue(int maximumFractionDigits)
Create a new empty resolution 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 field value in dots per inch.
|
java.lang.String |
getDisplayString()
Return the field's value as a string that can be displayed to the user.
|
java.lang.String |
getDisplayString(java.util.Locale locale)
Return the field's value as a string that can be displayed to the user.
|
java.lang.String |
getDisplayString(java.util.Locale locale,
int maximumFractionDigits)
Return the field's value as a string that can 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 field value in dots per inch.
|
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 ResolutionFieldValue()
public ResolutionFieldValue(int maximumFractionDigits)
public ResolutionFieldValue(double coreValue)
coreValue
- The double field value in dots per inch as it comes from the item.public ResolutionFieldValue(double coreValue, int maximumFractionDigits)
coreValue
- The double field value in dots per inch 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 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 double getCoreValue()
public void setCoreValue(double value)
Item.save()
to save this change back to the catalog.value
- The dpi valuepublic 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.