Package Model
Enum Class ServiceType
- All Implemented Interfaces:
- Serializable,- Comparable<ServiceType>,- Constable
The `ServiceType` enum represents various types of utility services, each with its associated unit charges and service charges.
- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionELECTRICITY service type.GAS service type.WATER service type.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprivateServiceType(double unitCharges, double serviceCharges) Constructs a `ServiceType` with the specified unit charges and service charges.
- 
Method SummaryModifier and TypeMethodDescriptiondoubleGet the service charges for this service type.doubleGet the unit charges for this service type.voidsetServiceCharges(double serviceCharges) Set the service charges for this service type.voidsetUnitCharges(double unitCharges) Set the unit charges for this service type.static ServiceTypeReturns the enum constant of this class with the specified name.static ServiceType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
- 
Enum Constant Details- 
ELECTRICITYELECTRICITY service type. Unit Charges: $0.12 per unit Service Charges: $10.0
- 
GASGAS service type. Unit Charges: $0.08 per unit Service Charges: $15.0
- 
WATERWATER service type. Unit Charges: $0.05 per unit Service Charges: $20.0
 
- 
- 
Field Details- 
unitChargesprivate double unitCharges
- 
serviceChargesprivate double serviceCharges
 
- 
- 
Constructor Details- 
ServiceTypeprivate ServiceType(double unitCharges, double serviceCharges) Constructs a `ServiceType` with the specified unit charges and service charges.- Parameters:
- unitCharges- The unit charges for the service type.
- serviceCharges- The service charges for the service type.
 
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
 
- 
valueOfReturns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum class has no constant with the specified name
- NullPointerException- if the argument is null
 
- 
getUnitChargespublic double getUnitCharges()Get the unit charges for this service type.- Returns:
- The unit charges.
 
- 
setUnitChargespublic void setUnitCharges(double unitCharges) Set the unit charges for this service type.- Parameters:
- unitCharges- The unit charges to set.
 
- 
getServiceChargespublic double getServiceCharges()Get the service charges for this service type.- Returns:
- The service charges.
 
- 
setServiceChargespublic void setServiceCharges(double serviceCharges) Set the service charges for this service type.- Parameters:
- serviceCharges- The service charges to set.
 
 
-