|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Resource
Field Summary | |
private java.util.Hashtable |
Data
|
Constructor Summary | |
Resource()
Class constructor. |
|
Resource(java.lang.String name,
java.lang.String size,
java.lang.String sharable,
java.lang.String type,
java.lang.String locktype,
java.lang.String time,
java.lang.String sr,
java.lang.String sa)
Class constructor that sets all fields. |
Method Summary | |
java.lang.String |
getLockType()
Gets the LockType. |
java.lang.String |
getName()
Returns the name of the resource |
int |
getSharable()
Returns the amount of sharable resources. |
int |
getSingleAgent()
Gets the amount of resource that an Agent may use at once. |
int |
getSingleRequest()
Returns an int that is the amount of resource that may be requested at one time. |
int |
getSize()
Returns the size of the resource. |
int |
getTime()
Returns an Integer value of the length of time an Agent may use the Resource. |
java.lang.String |
getType()
Gets the type of the resource. |
void |
setLockType(java.lang.String locktype)
Sets the LockType. |
void |
setName(java.lang.String name)
Sets the Name of the Resource. |
void |
setSharable(int sharable)
Sets the Amount of the resource that is sharable. |
void |
setSharable(java.lang.String sharable)
Sets the Amount of the resource that is sharable. |
void |
setSingleAgent(int sa)
Sets the amount of resource that may be used by one Agent. |
void |
setSingleAgent(java.lang.String sa)
Sets the amount of resource that may be requested by one Agent. |
void |
setSingleRequest(int sr)
Set the amount of resource that may be requested by an Agent at one time. |
void |
setSingleRequest(java.lang.String sr)
Set the amount of resource that may be requested by an Agent at one time. |
void |
setSize(int size)
Sets the number of resources. |
void |
setSize(java.lang.String size)
Sets the number of resources. |
void |
setTime(int time)
Sets the amount of time an Agent may use a resource. |
void |
setTime(java.lang.String time)
Sets the amount of time an Agent may use a resource. |
void |
setType(java.lang.String type)
Set's the Type of the Resource. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
|
Field Detail |
private java.util.Hashtable Data
Constructor Detail |
public Resource()
public Resource(java.lang.String name, java.lang.String size, java.lang.String sharable, java.lang.String type, java.lang.String locktype, java.lang.String time, java.lang.String sr, java.lang.String sa)
name
- The name of the Resource.size
- How much of the Resource.sharable
- How much of the Resource is sharable. May not
be greater than size.type
- The type of the Resource.locktype
- LockType of the Resoruce. see setLockType.time
- Sets the amount of time an Agent may use the resoruce.sr
- see setSingleRequest.sa
- see setSingleAgent.Method Detail |
public void setName(java.lang.String name)
name
- The name of the Resource.public java.lang.String getName()
public void setSize(int size) throws java.lang.Exception
size
- The amount of the resource. Throws Exception if size < 0.public void setSize(java.lang.String size) throws java.lang.Exception
size
- The amount of the resource. Throws Exception if size < 0.public int getSize()
public void setSharable(java.lang.String sharable) throws java.lang.Exception
sharable
- the amount that is sharable. Must be less than or equal to the total amount of resource.public void setSharable(int sharable) throws java.lang.Exception
sharable
- the amount that is sharable. Must be less than or equal to the total amount of resource.public int getSharable()
public void setType(java.lang.String type) throws java.lang.Exception
type
- Must be "reusable" or "replenishable" or "consumable".public java.lang.String getType()
public void setLockType(java.lang.String locktype) throws java.lang.Exception
locktype
- The LockType to set the Resource to.public java.lang.String getLockType()
public void setTime(java.lang.String time) throws java.lang.Exception
time
- A number.public void setTime(int time) throws java.lang.Exception
time
- A number.public int getTime()
public void setSingleRequest(java.lang.String sr) throws java.lang.Exception
sr
- String representation of a number to set Single Request to.public void setSingleRequest(int sr) throws java.lang.Exception
sr
- int representation of a number to set Single Request to.public int getSingleRequest()
public void setSingleAgent(java.lang.String sa) throws java.lang.Exception
sa
- String representaion of amount of resource that may be requested by one Agent.public void setSingleAgent(int sa) throws java.lang.Exception
sa
- int representaion of amount of resource that may used by one Agent.public int getSingleAgent()
public java.lang.String toString()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |