Package org.opencabstandard.provider
Class HOSContract.Clock
java.lang.Object
org.opencabstandard.provider.HOSContract.Clock
- All Implemented Interfaces:
android.os.Parcelable
- Enclosing class:
- HOSContract
Object representing an HOS clock for version 0.2. A clock contains a descriptive label and the value. The
value can be one of the types defined in the 
HOSContract.Clock.ValueType enum.
This type is included for to make backwards compatibility with older HOS consumers easier, since these
old consumers will not be able to parse the new version 0.3 clock structure if returned.
For new integrations, providers SHOULD return a HOSContract.ClockV2 instead if the consumer indicates
that it's supported.
An example of the different types of clocks is shown in the image below:

-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAllowed types for valueType field. -
Field Summary
FieldsFields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetLabel()Get the label for the clock.getValue()Get the value for the clock.Get the value typebooleanIs the important flag set.booleanIs the limitsDrivingRange flag set.voidsetImportant(boolean important) Indicates the important clock.voidLabel for the clock.voidsetLimitsDrivingRange(boolean limitsDrivingRange) Indicates which clock most tightly limits the time a driver can spend driving.voidThe value of the clock.voidsetValueType(HOSContract.Clock.ValueType valueType) The value type of the clock.voidwriteToParcel(android.os.Parcel dest, int flags)
-
Field Details
-
CREATOR
-
-
Constructor Details
-
Clock
public Clock()
-
-
Method Details
-
setLabel
Label for the clock.- Parameters:
label- The clock label.
-
setValue
The value of the clock. The format of this field will depend on theHOSContract.Clock.valueType field.- Parameters:
value- The clock value.
-
setValueType
The value type of the clock. SeeHOSContract.Clock.ValueTypefor the possible types.- Parameters:
valueType- The valueType for the clock.
-
setImportant
public void setImportant(boolean important) Indicates the important clock. Consumers may interpret this flag in multiple ways, but one possible use is to determine which clock to display in a compact view layout that only permits a single clock to be shown.- Parameters:
important- Flag indicating which is the most important clock in the list.
-
setLimitsDrivingRange
public void setLimitsDrivingRange(boolean limitsDrivingRange) Indicates which clock most tightly limits the time a driver can spend driving. Consumers may interpret this flag in multiple ways, but one possible use is to indicate where a driver needs to plan to shut down when planning a route.- Parameters:
limitsDrivingRange- Flag indicating which clock limits the driving range.
-
getLabel
Get the label for the clock.- Returns:
- The label for the clock.
-
getValue
Get the value for the clock.- Returns:
- The value for the clock.
-
getValueType
Get the value type- Returns:
- The value type for the clock.
-
isImportant
public boolean isImportant()Is the important flag set.- Returns:
- Flag indicating this is the most important clock.
-
isLimitsDrivingRange
public boolean isLimitsDrivingRange()Is the limitsDrivingRange flag set.- Returns:
- Flag indicating this clock will limit the driving range.
-
describeContents
public int describeContents()- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags) - Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-