Package org.opencabstandard.provider
Class HOSContract.ClockData
- java.lang.Object
-
- org.opencabstandard.provider.HOSContract.ClockData
-
- Enclosing class:
- HOSContract
public static class HOSContract.ClockData extends java.lang.Object
Object representing an HOS clock for version 0.4. A clock contains a descriptive label and the value. The value can be one of the types defined in theHOSContract.ClockData.ValueType
enum. Providers MUST NOT return this data type to a consumer if the consumer has not explicitly signaled support for at least version 0.4 by passing"0.4"
to the version parameter ofContentProvider.call(java.lang.String, java.lang.String, java.lang.String, android.os.Bundle)
.An example of the different types of clocks is shown in the image below:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HOSContract.ClockData.ValueType
Allowed types for valueType field.
-
Constructor Summary
Constructors Constructor Description ClockData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Double
getDurationSeconds()
Get the duration secondsjava.lang.String
getLabel()
Get the label for the clock.java.lang.String
getValue()
Get the value for the clock.HOSContract.ClockData.ValueType
getValueType()
Get the value typeboolean
isImportant()
Is the important flag set.boolean
isLimitsDrivingRange()
Is the limitsDrivingRange flag set.void
setDurationSeconds(java.lang.Double durationSeconds)
The duration seconds for the clock.void
setImportant(boolean important)
Indicates the important clock.void
setLabel(java.lang.String label)
Label for the clock.void
setLimitsDrivingRange(boolean limitsDrivingRange)
Indicates which clock most tightly limits the time a driver can spend driving.void
setValue(java.lang.String value)
The value of the clock.void
setValueType(HOSContract.ClockData.ValueType valueType)
The value type of the clock.
-
-
-
Method Detail
-
setLabel
public void setLabel(java.lang.String label)
Label for the clock.- Parameters:
label
- The clock label.
-
setValue
public void setValue(java.lang.String value)
The value of the clock. The format of this field will depend on theHOSContract.Clock
.valueType field.- Parameters:
value
- The clock value.
-
setValueType
public void setValueType(HOSContract.ClockData.ValueType valueType)
The value type of the clock. SeeHOSContract.ClockData.ValueType
for 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
public java.lang.String getLabel()
Get the label for the clock.- Returns:
- The label for the clock.
-
getValue
public java.lang.String getValue()
Get the value for the clock.- Returns:
- The value for the clock.
-
getValueType
public HOSContract.ClockData.ValueType 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.
-
getDurationSeconds
public java.lang.Double getDurationSeconds()
Get the duration seconds- Returns:
- The duration seconds for the clock.
-
setDurationSeconds
public void setDurationSeconds(java.lang.Double durationSeconds)
The duration seconds for the clock.- Parameters:
durationSeconds
- The duration seconds for the clock.
-
-