base.service
Class Service
java.lang.Object
base.service.Service
- All Implemented Interfaces:
- IXMLSaveable
public class Service
- extends java.lang.Object
- implements IXMLSaveable
Constructor Summary |
protected |
Service(int id,
java.lang.String name,
java.lang.String description,
java.lang.String rateType,
double baseRate,
int minDurationInMinute,
boolean careAboutMinDuration,
int maxDurationInMinute,
boolean careAboutMaxDuration)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Service
protected Service(int id,
java.lang.String name,
java.lang.String description,
java.lang.String rateType,
double baseRate,
int minDurationInMinute,
boolean careAboutMinDuration,
int maxDurationInMinute,
boolean careAboutMaxDuration)
- Parameters:
id
- The Service's id.name
- The Service's name.description
- The Service's description.rateType
- The Service's rateType.baseRate
- The Service's baseRate.minDurationInMinute
- The Service's minDurationInMinute.maxDurationInMinute
- The Service's maxDurationInMinute.careAboutMaxDuration
- States if must be applied the max duration or not.
getBaseRate
public double getBaseRate()
- Returns:
- Returns the baseRate.
setBaseRate
public void setBaseRate(double baseRate)
- Parameters:
baseRate
- The baseRate to set.
getDescription
public java.lang.String getDescription()
- Returns:
- Returns the description.
setDescription
public void setDescription(java.lang.String description)
- Parameters:
description
- The description to set.
getName
public java.lang.String getName()
- Returns:
- Returns the name.
setName
public void setName(java.lang.String name)
- Parameters:
name
- The name to set.
getId
public int getId()
- Returns:
- Returns the id.
getRateType
public java.lang.String getRateType()
- Returns:
- Returns the rateType.
setRateType
public void setRateType(java.lang.String rateType)
- Parameters:
rateType
- The rateType to set.
getMaxDurationInMinute
public int getMaxDurationInMinute()
- Returns:
- Returns the maxDurationInMinute.
setMaxDurationInMinute
public void setMaxDurationInMinute(int maxDurationInMinute)
- Parameters:
maxDurationInMinute
- The maxDurationInMinute to set.
getMinDurationInMinute
public int getMinDurationInMinute()
- Returns:
- Returns the minDurationInMinute.
setMinDurationInMinute
public void setMinDurationInMinute(int minDurationInMinute)
- Parameters:
minDurationInMinute
- The minDurationInMinute to set.
cost
public static double cost(java.util.Date startTime,
java.util.Date endTime,
java.lang.String rateType,
double baseRate)
- This method determines a service's cost on the bases of the provided
arguments.
- Parameters:
startTime
- The service's start time.endTime
- The service's end time.rateType
- The service's rate type.baseRate
- The service's test.base rate.
- Returns:
- The cost of a service according to the provided arguments.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
durationInMinute
public static double durationInMinute(java.util.Date startTime,
java.util.Date endTime)
- Parameters:
startTime
- A service's start time.endTime
- A service's end time.
- Returns:
- A minute rappresentation of a service's duration.
careAboutMaxDuration
public boolean careAboutMaxDuration()
- Returns:
- Returns the careAboutMaxDuration.
setCareAboutMaxDuration
public void setCareAboutMaxDuration(boolean careAboutMaxDuration)
- Parameters:
careAboutMaxDuration
- The careAboutMaxDuration to set.
careAboutMinDuration
public boolean careAboutMinDuration()
- Returns:
- Returns the careAboutMinDuration.
setCareAboutMinDuration
public void setCareAboutMinDuration(boolean careAboutMinDuration)
- Parameters:
careAboutMinDuration
- The careAboutMinDuration to set.
toXml
public org.w3c.dom.Node toXml(org.w3c.dom.Document document)
- Specified by:
toXml
in interface IXMLSaveable
Copyright © 2006 SF.net. All Rights Reserved.