public class TimeOnlyFieldValue extends java.lang.Object implements FieldValue, java.lang.Comparable<TimeOnlyFieldValue>
Item.getTimeOnlyValue(com.canto.cumulus.GUID)
to get this wrapper class object. You can then use Item.setTimeOnlyValue(com.canto.cumulus.GUID, TimeOnlyFieldValue)
to set the field value back into the item.Constructor and Description |
---|
TimeOnlyFieldValue()
Create a new empty time only field value.
|
TimeOnlyFieldValue(int coreValue)
Create a new time only field value from the given core field value.
|
Modifier and Type | Method and Description |
---|---|
void |
clearValue()
Clear the field's value.
|
int |
compareTo(TimeOnlyFieldValue other)
Compares this object with the specified object for order.
|
boolean |
equals(java.lang.Object o) |
int |
getCoreValue()
Get the core value of this field.
|
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.
|
int |
getHour()
Returns the hour represented by this time only field value object.
|
int |
getMilliSecond()
Returns the millisecond of the second represented by this time only field value object.
|
int |
getMinute()
Returns the minute of the hour represented by this time only field value object.
|
int |
getSecond()
Returns the second of the minute represented by this time only field value object.
|
int |
hashCode() |
boolean |
hasValue()
Return whether this field has a value.
|
void |
setCoreValue(int value)
Set the field value of this field to a number of milliseconds as the core value.
|
void |
setFromDisplayString(java.util.Locale locale,
java.lang.String value)
Set the field value from a display string.
|
void |
setFromDisplayString(java.lang.String value)
Set the field value from a display string.
|
void |
setHour(int hour)
Set the hour value of this time only field value.
|
void |
setMillisecond(int millis)
Set the millisecond of the second value of this time only field value.
|
void |
setMinute(int minute)
Set the minute of the hour value of this time only field value.
|
void |
setSecond(int second)
Set the second of the minute value of this time only field value.
|
java.lang.String |
toString()
Same as
getDisplayString() . |
public TimeOnlyFieldValue()
public TimeOnlyFieldValue(int coreValue)
coreValue
- The integer 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
- Unused parameter.public void setFromDisplayString(java.lang.String value) throws InvalidArgumentException
Item.save()
to save this change back to the catalog.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
- This parameter is not used.value
- The display string to set the value from.InvalidArgumentException
- if the display string is not of the right format.public int getHour()
0
..23
).public void setHour(int hour)
Item.save()
to save this change back to the catalog.hour
- the hour (0
..23
).public int getMinute()
0
..59
).public void setMinute(int minute)
Item.save()
to save this change back to the catalog.minute
- the minute of the hour (0
..59
).public int getSecond()
0
..59
).public void setSecond(int second)
Item.save()
to save this change back to the catalog.second
- the second of the minute (0
..59
).public int getMilliSecond()
0
..999
).public void setMillisecond(int millis)
Item.save()
to save this change back to the catalog.millis
- the millisecond of the second (0
..999
).public int getCoreValue()
public void setCoreValue(int value)
Item.save()
to save this change back to the catalog.value
- The number of milliseconds for this field value.public 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
public int compareTo(TimeOnlyFieldValue other)
compareTo
in interface java.lang.Comparable<TimeOnlyFieldValue>
other
- the object to be compared.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.