|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--agentland.resource.ResourceBunch
A collection of resources put in a hashtable format. This is what is returned by a resource call--it is all the various things (agents mainly) nabbed on behalf of the call, and any extra info needed.
Field Summary | |
protected boolean |
available
indicates if the resource in the bunch are usable right now or not (e.g. |
protected Need |
need
|
Constructor Summary | |
ResourceBunch()
An empty bundle. |
|
ResourceBunch(Resource res)
This is the most basic form of bundle, it holds a single resource. |
Method Summary | |
void |
addResource(Resource res)
|
void |
addResource(String name,
Resource res)
We need to key resources not by resource name but by REQUEST name; i.e. |
void |
dump(PrintStream ps)
|
void |
fixUp(AgentAgent pop)
This goes through and changes any AgentIDs to Agents, so things like getOnlyAgent and whatnot don't cause class cast exceptions by finding AgentIDs When a managed agent, you should not need to make this call. |
Object |
get(Object o)
|
Agent |
getAgent(Resource res)
|
Agent |
getAgent(String res)
|
AgentID |
getAgentID(String res)
Returns AgentID of the resource stored under given name (this name is usually the name of the request that got us the resource) |
Need |
getNeed()
Get the value of need. |
Agent |
getOnlyAgent()
|
Resource |
getOnlyResource()
|
Resource |
getResource(String name)
Gives you the resource of a given name |
Collection |
getResources()
|
Object |
getTiedTo()
Just a shortcut -- returns the first tied to in the tied to list -- it's an object because it may be either a String or an AgentID |
List |
getTiedTos()
|
boolean |
isAvailable()
|
void |
merge(ResourceBunch rb)
|
void |
setAvailable(boolean v)
|
void |
setNeed(Need v)
Set the value of need. |
void |
setTiedTos(Vector v)
|
int |
size()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Need need
protected boolean available
Constructor Detail |
public ResourceBunch()
public ResourceBunch(Resource res)
Method Detail |
public Collection getResources()
public int size()
public boolean isAvailable()
public void setAvailable(boolean v)
public Resource getOnlyResource()
public Resource getResource(String name)
name
- name of the resourcepublic void addResource(Resource res)
public void addResource(String name, Resource res)
public void merge(ResourceBunch rb)
public void setTiedTos(Vector v)
public List getTiedTos()
public Object getTiedTo()
public Object get(Object o)
public Agent getAgent(Resource res)
public Agent getAgent(String res)
public AgentID getAgentID(String res) throws RemoteException
public Agent getOnlyAgent()
public Need getNeed()
public void setNeed(Need v)
v
- Value to assign to need.public String toString()
toString
in class Object
public void dump(PrintStream ps)
public void fixUp(AgentAgent pop)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |