agentland.drug
Class Broker
java.lang.Object
|
+--agentland.drug.Broker
- public class Broker
- extends Object
This is not an agent--anyone can have one. It is the
best way to pull information about drugs from the sql
database.
Method Summary |
boolean |
connectible(AgentID start,
AgentID stop)
returns true if a path from start to stop exists
false otherwise |
protected boolean |
findInTree(DrugTreeNode root,
AgentID a)
|
Drug |
getDrug(int drugID)
|
Drug |
getDrug(String name)
|
DrugTreeNode |
getDrugConnectionTree(AgentID drugAgent)
|
DrugTreeNode |
getDrugConnectionTree(AgentID drugAgent,
int depth)
|
DrugTreeNode |
getDrugConnectionTree(DrugTreeNode root)
|
DrugTreeNode |
getDrugConnectionTree(DrugTreeNode root,
int depth)
|
DrugTreeNode |
getDrugConnectionTree(HashSet bottom,
DrugTreeNode root)
|
DrugTreeNode |
getDrugConnectionTree(HashSet bottom,
DrugTreeNode root,
int depth)
|
Vector |
getDrugs(AgentID agent)
|
Vector |
getDrugs(String name)
|
Vector |
getDrugs(String society,
String occupation,
String designation)
returns all drugs given agents occupation, society and designation;
use null as a wildcard
returns a vector of |
Vector |
getNames(AgentID agent)
|
Vector |
getNames(Drug drug)
|
protected ResultSet |
queryDB(String qry)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Broker
public Broker()
queryDB
protected ResultSet queryDB(String qry)
getDrugs
public Vector getDrugs(String society,
String occupation,
String designation)
- returns all drugs given agents occupation, society and designation;
use null as a wildcard
returns a vector of
getDrug
public Drug getDrug(int drugID)
getDrug
public Drug getDrug(String name)
- Returns:
- the Drug given one of its names. If multiple hits, then
return single drug.
getDrugs
public Vector getDrugs(String name)
- Returns:
- all Drugs given a name.
getDrugs
public Vector getDrugs(AgentID agent)
getNames
public Vector getNames(Drug drug)
getNames
public Vector getNames(AgentID agent)
getDrugConnectionTree
public DrugTreeNode getDrugConnectionTree(AgentID drugAgent)
getDrugConnectionTree
public DrugTreeNode getDrugConnectionTree(AgentID drugAgent,
int depth)
getDrugConnectionTree
public DrugTreeNode getDrugConnectionTree(DrugTreeNode root)
getDrugConnectionTree
public DrugTreeNode getDrugConnectionTree(DrugTreeNode root,
int depth)
getDrugConnectionTree
public DrugTreeNode getDrugConnectionTree(HashSet bottom,
DrugTreeNode root)
getDrugConnectionTree
public DrugTreeNode getDrugConnectionTree(HashSet bottom,
DrugTreeNode root,
int depth)
connectible
public boolean connectible(AgentID start,
AgentID stop)
- returns true if a path from start to stop exists
false otherwise
findInTree
protected boolean findInTree(DrugTreeNode root,
AgentID a)