|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--webfunds.utils.Debug
|
+--webfunds.ricardian.DirContractStore
Read in a directory of contracts and provide access to them. Derived from client.DirContractStore and InfoBag.pm.
| Field Summary | |
protected java.util.Hashtable |
allNames
All the names, pointing to ItemIds of contracts that answer to the name. |
protected java.util.Hashtable |
contracts
All the contracts, indexed by ItemId. |
protected java.io.File |
dir
|
| Fields inherited from class webfunds.utils.Debug |
bug,
debugAll,
logfix |
| Constructor Summary | |
DirContractStore()
Read in a directory of contracts and provide access to them. |
|
DirContractStore(java.io.File storedir)
Read in a directory of contracts and provide access to them. |
|
DirContractStore(java.io.File storedir,
java.io.PrintWriter bug)
Read in a directory of contracts and provide access to them. |
|
| Method Summary | |
void |
addContract(Contract contract)
Add a new contract to the store. |
void |
addDirectory(java.io.File readDir)
Read in a user directory of contracts. |
protected void |
addThisName(java.lang.String name,
ItemId id)
Add the hash as a contract that answers to name. |
protected void |
dropNames(Contract con)
|
protected void |
dropThisName(java.lang.String name,
ItemId id)
|
Contract[] |
getAllContracts()
Unique list - contracts appear once and only once. |
ItemId[] |
getAllIds()
One to one with getAllContracts(). |
java.lang.String[] |
getAllNames()
There are many names for each contract, this list will be larger than the number of contracts. |
Contract |
getContract(ItemId hash)
Return a contract named by hash. |
Contract[] |
getContractsByName(java.lang.String name)
Return a list of contracts answering to the given name. |
java.io.File |
getDirectory()
Get the directory of contracts. |
ItemId[] |
getIdsByName(java.lang.String name)
|
java.lang.String[] |
getShortNamesWithClashes()
Unique list of names - names appear once and only once, but each name might represent more than one contract. |
java.lang.String |
getType()
Unknown? |
Contract |
getUniqueContract(java.lang.String name)
Always returns a contract? |
static void |
main(java.lang.String[] arg)
|
protected void |
readDirectory(java.io.File readDir,
java.io.File storeDir)
Read in a directory of contracts and store them in a different place. |
protected void |
readNamesForContract(Contract contract)
Index the various names by which the contract is known. |
void |
removeContract(Contract remcontract)
Drop a contract from the store. |
protected void |
setDirectory(java.io.File storedir)
Read in a directory of contracts. |
java.lang.String |
toString()
|
| Methods inherited from class webfunds.utils.Debug |
debug,
debug,
debug,
debug,
err,
getDebug,
logend,
logmsg,
logstart,
logword |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected java.util.Hashtable contracts
protected java.util.Hashtable allNames
protected java.io.File dir
| Constructor Detail |
public DirContractStore()
public DirContractStore(java.io.File storedir)
throws ContractDirectoryException
storedir - a directory with contracts
public DirContractStore(java.io.File storedir,
java.io.PrintWriter bug)
throws ContractDirectoryException
storedir - a directory with contractsbug - place to put debugging during construction| Method Detail |
public java.io.File getDirectory()
public java.lang.String getType()
protected void readDirectory(java.io.File readDir,
java.io.File storeDir)
throws ContractDirectoryException
public void addDirectory(java.io.File readDir)
throws ContractDirectoryException
protected void setDirectory(java.io.File storedir)
throws ContractDirectoryException
protected void readNamesForContract(Contract contract)
public void addContract(Contract contract)
throws ContractException
public void removeContract(Contract remcontract)
contract - is the object that should be dropped.
protected void addThisName(java.lang.String name,
ItemId id)
protected void dropNames(Contract con)
protected void dropThisName(java.lang.String name,
ItemId id)
public Contract[] getAllContracts()
public java.lang.String[] getShortNamesWithClashes()
public Contract getContract(ItemId hash)
public Contract getUniqueContract(java.lang.String name)
throws ContractException
public Contract[] getContractsByName(java.lang.String name)
public ItemId[] getIdsByName(java.lang.String name)
public ItemId[] getAllIds()
public java.lang.String[] getAllNames()
public java.lang.String toString()
public static void main(java.lang.String[] arg)
throws ContractException,
ContractDirectoryException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||