|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.mdr.persistence.btreeimpl.btreestorage.NameIndex
org.netbeans.mdr.persistence.btreeimpl.btreestorage.MofidIndex
This is an index from names (Strings) to MOFIDs. Its primary use is to store the MOFIDs for secondary indexes.
Field Summary | |
protected java.util.HashMap |
hashOnName
|
Constructor Summary | |
MofidIndex()
Create a new MofidIndex |
|
MofidIndex(BtreeStorage storage)
Create a new MofidIndex |
Method Summary | |
void |
add(java.lang.String name,
MOFID id)
Add a name-MOFID pair to the MofidIndex. |
protected void |
addObj(java.lang.String name,
java.lang.Object id)
Add a name-Object pair to the NameIndex. |
void |
clear()
Remove all name-Object pairs from the NameIndex. |
MOFID |
get(java.lang.String name)
get a MOFID by its name. |
protected java.lang.Object |
getObj(java.lang.String name)
get an object by its name. |
protected java.lang.Object |
getObjIf(java.lang.String name)
get an object by its name. |
java.util.Iterator |
iterator()
iterate over entries |
java.lang.String[] |
listNames()
return the names of all objects in the NameIndex, in no particular order. |
void |
read(java.io.DataInputStream dstrm)
read from a DataOutputStream |
void |
read(java.io.InputStream strm)
deserialize the NameIndex from a stream. |
protected java.lang.Object |
readObjectFromStream(java.io.DataInputStream strm)
read object from stream. |
void |
remove(java.lang.String name)
Remove a name-Object pair from the NameIndex. |
void |
setName(java.lang.String nm)
give object a name |
void |
setStorage(Storage storage)
called on deserialization |
java.lang.String |
toString()
return name set with setName |
void |
write(java.io.DataOutputStream dstrm)
write to a DataOutputStream |
void |
write(java.io.OutputStream strm)
serialize the NameIndex to a stream. |
protected void |
writeObjectToStream(java.lang.Object obj,
java.io.DataOutputStream strm)
write object to stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.HashMap hashOnName
Constructor Detail |
public MofidIndex()
public MofidIndex(BtreeStorage storage)
Method Detail |
public MOFID get(java.lang.String name) throws StorageException
name
- the name associated with the MOFID
StorageException
public void add(java.lang.String name, MOFID id) throws StorageException
name
- name of object to add to indexid
- MOFID of object to add
StorageException
protected void writeObjectToStream(java.lang.Object obj, java.io.DataOutputStream strm) throws StorageException
obj
- object to writestrm
- stream to write it to
StorageException
protected java.lang.Object readObjectFromStream(java.io.DataInputStream strm) throws StorageException
strm
- stream to read from
StorageException
public void setStorage(Storage storage)
setStorage
in interface StorageClient
storage
- the Stroage implementation which
instantiated the objectpublic void setName(java.lang.String nm)
nm
- name of NameIndexpublic java.lang.String toString()
protected java.lang.Object getObj(java.lang.String name) throws StorageException
name
- the name associated with the object
StorageException
protected java.lang.Object getObjIf(java.lang.String name) throws StorageException
name
- the name associated with the object
StorageException
protected void addObj(java.lang.String name, java.lang.Object id) throws StorageException
name
- name of object to add to indexid
- object to add
StorageException
public void remove(java.lang.String name) throws StorageException
name
- name of object to rmove from index
StorageException
public void clear()
public java.lang.String[] listNames()
public java.util.Iterator iterator()
public void write(java.io.OutputStream strm) throws StorageException
number of pairs
name of object 1 (in UTF-8)
Representation of object 1
... name of object N (in UTF-8)
Representation of object N
write
in interface Streamable
strm
- stream to serialize to
StorageException
public void write(java.io.DataOutputStream dstrm) throws StorageException
StorageException
public void read(java.io.InputStream strm) throws StorageException
read
in interface Streamable
strm
- stream to deserialize from
StorageException
public void read(java.io.DataInputStream dstrm) throws StorageException
StorageException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |