com.rbnb.api
Class Rmap

java.lang.Object
  extended by com.rbnb.api.Rmap
All Implemented Interfaces:
com.rbnb.utility.SortCompareInterface, com.rbnb.utility.SortInterface, Serializable, Cloneable
Direct Known Subclasses:
ControllerHandle, DataRequest, EndOfStream, Server

public class Rmap
extends Object
implements com.rbnb.utility.SortCompareInterface

Hierarchical description of data.

An Rmap consists of six major parts:

  1. A name,
  2. A time TimeRange,
  3. A frame index TimeRange,
  4. A data block,
  5. A list of group member Rmaps, and
  6. A list of child Rmaps.

The optional name is a string that provides part of the unique identification for this Rmap within its parent Rmap's group or child list.

The optional time TimeRange provides the remainder of the unique identification for this Rmap within its parent Rmap's group or child list.

The optional frame index TimeRange provides the frame index(es) represented by this Rmap. A "frame" is defined as a single Rmap hierarchy sent by a source application to the server. The server provides a monotonically increasing index for each frame.

A parent Rmap can contain only a single Rmap with a particular combination of name and time (including no name and no TimeRange). Rmaps are sorted in a list (group or child) by name (nameless Rmaps come first) and then by time (timeless Rmaps come first).

The optional DataBlock describes and optionally provides the data belonging to this Rmap and its children.

The optional group list contains Rmaps that inherit the children of this Rmap as children of themselves.

The optional children list contains Rmaps that belong to this Rmap and its group members.

Since:
V2.0
See Also:
DataBlock, DataReference, DataArray, TimeRange, Serialized Form
Author:
Ian Brown
Version:
05/12/2005

Field Summary
static char PATHDELIMITER
          the delimiter between names in a fully specified channel name path.
 
Constructor Summary
Rmap()
          Class constructor.
Rmap(String nameI)
          Class constructor to build an Rmap from a name.
Rmap(String nameI, DataBlock dblockI, TimeRange trangeI)
          Class constructor to build an Rmap from a name, data block, and TimeRange.
 
Method Summary
 Rmap addChannel(String channelNameI)
          Adds a new Rmap hierarchy (channel name) to an existing hierarchy.
 void addChild(Rmap childI)
          Adds a child Rmap to this Rmap.
 void addChildAt(Rmap childI, int indexI)
          Adds a child Rmap to this Rmap at the specified index.
 void addDataWithTimeReference(Object dataI, int ndataI, int ptsizeI, byte dtypeI, byte worderI, DataArray referenceI)
          Adds data to this Rmap hierarchy with a DataArray supplying the TimeRanges.
 void addMember(Rmap memberI)
          Adds a member Rmap to this Rmap.
 Object clone()
          Clones this Rmap.
 boolean collapse()
          Collapses this Rmap hierarchy.
 int compareNames(Rmap otherI)
          Compares the name of this Rmap to the name of the input Rmap.
 int compareNames(String nameI)
          Compares the name of this Rmap to the input name.
static int compareNames(String nameI, String name2I)
          Compares the input names.
 int compareTo(Object sidI, Object otherI)
          Compares the sorting value of this Rmap to the input sorting value according to the type sort specified by the sort identifier.
 int compareTo(Rmap rmapI)
          Compares the input Rmap to this one.
static Rmap createFromName(String nameI)
          Creates an Rmap hierarchy from the input name.
 DataArray extract(String chanNameI)
          Extracts the time and data for a particular channel.
 DataArray extract(String chanNameI, boolean frameFlagI, boolean timeFlagI, boolean dataFlagI)
          Extracts the frame indexes, time, and/or data for a particular channel.
 String[] extractFolders()
          Extracts the names of folders from this Rmap hierarchy.
 String[] extractFoldersAndChannels()
          Extracts the names of channels and folders from this Rmap hierarchy.
 String[] extractNames()
          Extracts the names from this Rmap hierarchy.
 Rmap extractRmap(Rmap requestI, boolean dataFlagI)
          Extracts Rmaps from this Rmap that match the input request Rmap.
 Rmap findChild(Rmap childI)
          Finds a matching child Rmap.
 Rmap findDescendant(String nameI, boolean addI)
          Finds a descendant Rmap by name.
 Rmap findMember(Rmap memberI)
          Finds a matching member Rmap.
 Rmap getChildAt(int indexI)
          Gets the child at the specified index.
 com.rbnb.api.RmapVector getChildren()
          Gets the list of children of this Rmap.
 DataBlock getDblock()
          Gets the DataBlock of this Rmap.
 TimeRange getFrange()
          Gets the frame index TimeRange of this Rmap.
 String getFullName()
          Gets the fully qualified name of this Rmap.
 Rmap getMemberAt(int indexI)
          Gets the member at the specified index.
 com.rbnb.api.RmapVector getMembers()
          Gets the group members of this Rmap.
 String getName()
          Gets the name of this Rmap.
 int getNchildren()
          Gets the number of children.
 int getNmembers()
          Gets the number of members.
 Rmap getParent()
          Gets the parent Rmap of this Rmap.
 TimeRange getTrange()
          Gets the TimeRange of this Rmap.
 boolean isImplemented(byte typeI)
          Is the specified type of operation implemented?
 void markLeaf()
          Marks leaf nodes of an Rmap hierarchy by putting in single byte DataBlocks.
 Rmap mergeWith(Rmap rmapI)
          Merges the input Rmap hierarchy with this one.
 Rmap moveToBottom()
          Moves to the bottom of this Rmap hierarchy.
 Rmap moveToTop()
          Moves to the top of this Rmap hierarchy.
 void nullify()
          Nullifies this Rmap.
 void removeChild(Rmap childI)
          Removes a child Rmap from this Rmap.
 void removeChildAt(int indexI)
          Removes the child Rmap at a particular index from this Rmap.
 void removeMember(Rmap memberI)
          Removes a member Rmap from this Rmap.
 void removeMemberAt(int indexI)
          Removes the member Rmap at a particular index from this Rmap.
 void setDblock(DataBlock dblockI)
          Sets the DataBlock of this Rmap.
 void setFrange(TimeRange frangeI)
          Sets the frame index TimeRange of this Rmap.
 void setName(String nameI)
          Sets the name of this Rmap.
 void setTrange(TimeRange trangeI)
          Sets the TimeRange of this Rmap.
 Object sortField(Object sidI)
          Gets the sorting value for this Rmap.
 Rmap toNameHierarchy()
          Creates an Rmap hierarchy that can be used to make requests for the names.
 String toString()
          Gets a displayable string representation of this Rmap.
 String toString(boolean memberI, String indentI)
          Gets a displayable string representation of this Rmap.
static String xmlRegistration(long lengthI, String mimeTypeI)
          Produces an XML description of the specified length for the registration map.
static String xmlRegistration(long lengthI, String mimeTypeI, String xmlI)
          Produces an XML description of the specified length and the MIME type for the registration map.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PATHDELIMITER

public static final char PATHDELIMITER
the delimiter between names in a fully specified channel name path.

Since:
V2.0
See Also:
Constant Field Values
Author:
Ian Brown
Version:
05/10/2001
Constructor Detail

Rmap

public Rmap()
Class constructor.

Since:
V2.0
See Also:
Rmap(String), Rmap(String,DataBlock,TimeRange)
Author:
Ian Brown
Version:
05/10/2001

Rmap

public Rmap(String nameI)
     throws AddressException,
            SerializeException,
            EOFException,
            InterruptedIOException,
            IOException,
            InterruptedException
Class constructor to build an Rmap from a name.

Parameters:
nameI - the name of the Rmap.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
InterruptedIOException - thrown if this operation is interrupted during I/O.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
See Also:
Rmap()
Author:
Ian Brown
Version:
06/04/2001

Rmap

public Rmap(String nameI,
            DataBlock dblockI,
            TimeRange trangeI)
     throws AddressException,
            SerializeException,
            EOFException,
            InterruptedIOException,
            IOException,
            InterruptedException
Class constructor to build an Rmap from a name, data block, and TimeRange.

Parameters:
nameI - the name of the Rmap.
dblockI - the DataBlock.
trangeI - the TimeRange.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
InterruptedIOException - thrown if this operation is interrupted during I/O.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
06/04/2001
Method Detail

addChannel

public final Rmap addChannel(String channelNameI)
                      throws AddressException,
                             SerializeException,
                             EOFException,
                             IOException,
                             InterruptedException
Adds a new Rmap hierarchy (channel name) to an existing hierarchy.

This method creates the minimum number of additional Rmaps needed to add the new hierarchy by matching names in the new hierarchy to those in the existing hierarchy.

If necessary, this method creates a common parent for the existing hierarchy and the new one.

Parameters:
channelNameI - the name to add.
Returns:
the new Rmap representing the channel.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
IllegalArgumentException - thrown if there is a problem with the input name.
IllegalStateException - thrown if this Rmap already has a parent.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
08/06/2004

addChild

public void addChild(Rmap childI)
              throws AddressException,
                     SerializeException,
                     EOFException,
                     IOException,
                     InterruptedException
Adds a child Rmap to this Rmap.

Parameters:
childI - the new child Rmap.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
IllegalArgumentException - thrown if the input Rmap is already a child of another Rmap or if the input is null.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
02/17/2004

addChildAt

public void addChildAt(Rmap childI,
                       int indexI)
                throws AddressException,
                       SerializeException,
                       EOFException,
                       IOException,
                       InterruptedException
Adds a child Rmap to this Rmap at the specified index.

Parameters:
childI - the new child Rmap.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
IllegalArgumentException - thrown if the input Rmap is already a child of another Rmap or if the input is null.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.1
Author:
Ian Brown
Version:
02/17/2004

addDataWithTimeReference

public final void addDataWithTimeReference(Object dataI,
                                           int ndataI,
                                           int ptsizeI,
                                           byte dtypeI,
                                           byte worderI,
                                           DataArray referenceI)
                                    throws AddressException,
                                           SerializeException,
                                           EOFException,
                                           IOException,
                                           InterruptedException
Adds data to this Rmap hierarchy with a DataArray supplying the TimeRanges.

The method adds one or more unnamed Rmaps to this Rmap.

This method is intended to allow plugins to efficiently copy time values from their input to their output without having to go through extracting the individual time values.

Parameters:
dataI - the data object.
ndataI - the number of data points in the input.
ptsizeI - the size of a data point in bytes.
dtypeI - the type of data.
worderI - the word order.
referenceI - the DataArray reference.

The number of points in the reference must be equal to the number of points in the data object.

Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
IllegalArgumentException - thrown if the input Rmap is already a child of another Rmap or if the input is null.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
01/02/2003

addMember

public void addMember(Rmap memberI)
               throws SerializeException,
                      EOFException,
                      IOException,
                      InterruptedException
Adds a member Rmap to this Rmap.

Parameters:
memberI - the new member Rmap.
Throws:
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
IllegalArgumentException - thrown if the input Rmap is already a child of another Rmap or if the input is null.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
See Also:
getMembers(), getParent(), removeMember(com.rbnb.api.Rmap), removeMemberAt(int)
Author:
Ian Brown
Version:
05/10/2001

clone

public Object clone()
Clones this Rmap.

This method clones the member and child Rmaps, the frame and time TimeRanges, and the DataBlock.

Returns:
the clone.
Since:
V2.0
Author:
Ian Brown
Version:
08/14/2001

collapse

public final boolean collapse()
                       throws AddressException,
                              SerializeException,
                              InterruptedIOException,
                              IOException,
                              InterruptedException
Collapses this Rmap hierarchy.

This method collapses and reorganizes the Rmap hierarchy rooted at the input Rmap to produce the most efficient structure possible, given reasonable time constraints.

The method recursively performs the following operations:

  1. Collapses its member and child hierarchies,
  2. Eliminates itself if it contains no useful information,
  3. If there is a single child and no members, and that child contains only information not found in this Rmap, collapses out the child Rmap,
  4. Eliminates redundant TimeRanges from its children children by moving the TimeRange to this Rmap if that won't change the meaning of the hierarchy, and
  5. Eliminates redudant Rmap hierarchies if it is possible to move a single copy of their children to the current level and create groups using data pools.

Note that this method replaces elements of this Rmap hierarchy in place. It does not copy information unless absolutely necessary.

Note that the data pool creation logic is not completed. Look into this further. It is turned off for now.

Returns:
keep this Rmap?
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with serialization.
InterruptedIOException - thrown if this operation is interrupted during I/O.
IOException - thrown if there is an I/O problem.
InterruptedException - thrown if this operation is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
02/07/2002

compareNames

public final int compareNames(Rmap otherI)
Compares the name of this Rmap to the name of the input Rmap.

Parameters:
otherI - the other Rmap.
Returns:
the results of the comparison:
  • <0 if this Rmap compares less than the input,
  • 0 if this Rmap compares equal to the input, and
  • >0 if this Rmap compares greater than the input.
Since:
V2.0
Author:
Ian Brown
Version:
05/10/2001

compareNames

public final int compareNames(String nameI)
Compares the name of this Rmap to the input name.

Parameters:
nameI - the name to compare to.
Returns:
the results of the comparison:

<0 if this Rmap compares less than the input,

0 if this Rmap compares equal to the input, and

>0 if this Rmap compares greater than the input.

Since:
V2.0
Author:
Ian Brown
Version:
05/10/2001

compareNames

public static final int compareNames(String nameI,
                                     String name2I)
Compares the input names.

Parameters:
nameI - the first name.
name2I - the second name.
Returns:
the results of the comparison:

<0 if this Rmap compares less than the input,

0 if this Rmap compares equal to the input, and

>0 if this Rmap compares greater than the input.

Since:
V2.0
Author:
Ian Brown
Version:
05/10/2001

compareTo

public int compareTo(Object sidI,
                     Object otherI)
              throws com.rbnb.utility.SortException
Compares the sorting value of this Rmap to the input sorting value according to the type sort specified by the sort identifier.

The sorting value for an Rmap is always itself. The comparison is first by name, then by frame TimeRange, and finally by TimeRange.

Specified by:
compareTo in interface com.rbnb.utility.SortCompareInterface
Parameters:
sidI - the sort type identifier -- must be null.
otherI - the other sorting value.
Returns:
the results of the comparison:

<0 if this Rmap compares less than the input,

0 if this Rmap compares equal to the input, and

>0 if this Rmap compares greater than the input.

Throws:
com.rbnb.utility.SortException - thrown if the input sort identifier is non-null.
IllegalStateException - thrown if both the this Rmap and the input Rmap are nameless and timeless.
Since:
V2.0
See Also:
compareTo(com.rbnb.api.Rmap)
Author:
Ian Brown
Version:
08/30/2002

compareTo

public int compareTo(Rmap rmapI)
Compares the input Rmap to this one.

Parameters:
rmapI - the Rmap to compare.
Returns:
the results of the comparison:

<0 if this Rmap compares less than the input,

0 if this Rmap compares equal to the input, and

>0 if this Rmap compares greater than the input.

Since:
V2.0
See Also:
compareTo(Object,Object)
Author:
Ian Brown
Version:
05/10/2001

createFromName

public static final Rmap createFromName(String nameI)
                                 throws AddressException,
                                        SerializeException,
                                        EOFException,
                                        IOException,
                                        InterruptedException
Creates an Rmap hierarchy from the input name.

Parameters:
nameI - the name.
Returns:
the top of the Rmap hierarchy.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
IllegalArgumentException - thrown if the input Rmap is already a child of another Rmap or if the input is null.
InterruptedException - thrown if the creation is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
09/18/2001

extract

public final DataArray extract(String chanNameI)
                        throws AddressException,
                               SerializeException,
                               EOFException,
                               IOException,
                               InterruptedException
Extracts the time and data for a particular channel.

This method requires that all of the data for the channel be of a single data type. The returned result is an array of the data type, returned as a single object.

If there is no time or data information available for the specified channel, an empty DataArray object is returned, with null time and data fields.

Parameters:
chanNameI - the fully qualified name of the channel.
Returns:
a DataArray object containing the extracted times and data.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
IllegalArgumentException - thrown if the input Rmap is already a child of another Rmap or if the input is null.
InterruptedException - thrown if the operation is interrupted.
IllegalStateException - thrown if the Rmap hierarchy contains information that cannot be processed by this code.
Since:
V2.0
Author:
Ian Brown
Version:
08/30/2002

extract

public final DataArray extract(String chanNameI,
                               boolean frameFlagI,
                               boolean timeFlagI,
                               boolean dataFlagI)
                        throws AddressException,
                               SerializeException,
                               EOFException,
                               IOException,
                               InterruptedException
Extracts the frame indexes, time, and/or data for a particular channel.

This method requires that all of the data for the channel be of a single data type. The returned result is an array of the data type, returned as a single object.

If there is no frame, time, or data information available for the specified channel, an empty DataArray object is returned, with null frame, time, and data fields.

Parameters:
chanNameI - the fully qualified name of the channel.
frameFlagI - return the extracted frame indexes?
timeFlagI - return the extacted times?
dataFlagI - return the extraced data?
Returns:
a DataArray object containing the extracted times and data.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
IllegalArgumentException - thrown if the input Rmap is already a child of another Rmap or if the input is null.
InterruptedException - thrown if the operation is interrupted.
IllegalStateException - thrown if the Rmap hierarchy contains information that cannot be processed by this code.
Since:
V2.0
Author:
Ian Brown
Version:
05/06/2003

extractFolders

public final String[] extractFolders()
                              throws AddressException,
                                     SerializeException,
                                     EOFException,
                                     IOException,
                                     InterruptedException
Extracts the names of folders from this Rmap hierarchy.

Folders are defined as named Rmaps with no children.

Returns:
array of the names found.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.1
Author:
Ian Brown
Version:
05/09/2003

extractFoldersAndChannels

public final String[] extractFoldersAndChannels()
                                         throws AddressException,
                                                SerializeException,
                                                EOFException,
                                                IOException,
                                                InterruptedException
Extracts the names of channels and folders from this Rmap hierarchy.

Channels are defined as names with data (equivalent to the results of extractNames). Folders are defined as named Rmaps with no children.

Returns:
array of the names found.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.1
Author:
Ian Brown
Version:
05/06/2003

extractNames

public final String[] extractNames()
                            throws AddressException,
                                   SerializeException,
                                   EOFException,
                                   IOException,
                                   InterruptedException
Extracts the names from this Rmap hierarchy.

Returns:
array of the names found.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
08/30/2002

extractRmap

public Rmap extractRmap(Rmap requestI,
                        boolean dataFlagI)
                 throws AddressException,
                        SerializeException,
                        EOFException,
                        IOException,
                        InterruptedException
Extracts Rmaps from this Rmap that match the input request Rmap.

This is a complicated process that does what appears to be a relatively simple task, namely finding the subset of the Rmap hiearchy headed by this Rmap that matches the input request. It is complicated by the fact that Rmaps are a recursive structure that allows for inheritance of information from the top down to the bottom. In addition, the Rmap design at the time that this code was written was such that no assumptions could be made about the structure of any particular, non-specialized Rmap.

The processing involves a number of different objects:

  1. Rmap and its subclasses (such as DataRequest, RBO, RingBuffer, etc.),
  2. TimeRange,
  3. RmapExctractor, and
  4. RmapChain and its subclass ExtractedChain.

The process starts by creating an RmapExtractor, which acts as the central dispatch and depository. An ExtractedChain is created to start the process of matching the source Rmap hierarchy against the request.

From there, the process proceeds to compare information in the source Rmap hierarchy against the request, moving down the two hierarchies, until a point in the source Rmap hierarchy is reached such that its name, time, and data match a portion of the request hierarchy. This is a recursive search sequence that goes through the following:

  1. ExtractedChain.matchList - matches the list of Rmaps at the next level down in the source hierarchy against the current level of the request hierarchy,
  2. One of:

    1. ExtractedChain.moveDown - moves down past a nameless/timeless entry in the request hierarchy. If there are multiple children in the request hierarchy, a separate ExtractedChain is started for each one. This loops back to the first step,
    2. ExtractedChain.matchListCurrent - matches the source list against the current level in the request hierarchy with no inherited information from higher up the request hierarchy,
    3. ExtractedChain.matchListInherited - matches the source list against just the inherited information from higher up in the request hierarchy, or
    4. ExtractedChain.matchListCurrentAndInherited - matches the source list against a request consisting of the combination of the current request and the inherited information from higher up,
  3. ExtractedChain.matchListAgainst - performs the actual matching of the source list against the request (inherited, current, current+inherited),
  4. RmapVector.findMatches - performs a modified binary search for the request name and time within the source list,
  5. If no matches are found at the current level, but there was enough information available from higher levels to qualify as a match, then extract that information using RmapExtractor.extractInformation,
  6. If no matches are found at the current level and there isn't enough information available from higher levels to qualify as a match, then note that we were unable to find a match,
  7. If a list of matches was found, then loop through and process each match individually using ExtractedChain.matchedList,
  8. ExtractedChain.matchRmap builds one or more new ExtractedChains containing the matched source Rmap, the request that matched it (inherited, current, or current+inherited), inherited information consisting of the inherited information from above plus any unmatched name and time range from the matching request (ExtractedChain.updateInherited), and one child from the next level of request hierarchy as the ExtractedChain's request,
  9. If we've reached the bottom of the request hierarchy and there is enough information from the source hierarchy (name, time, data) to declare a match, then the match is extracted (RmapExtractor.extractInformation),
  10. If there is more work to do to match the request, then ExtractedChain.moveDownFrom starts moving down a level in the source hierarchy,
  11. Rmap.moveDownFrom (and the moveDownFrom methods from Rmap's specialized subclasses) moves down one level in the source hierarchy and starts the process over again.

Parameters:
requestI - the request Rmap.
dataFlagI - extract the data payloads?
Returns:
the matched Rmap hierarchy.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
IllegalStateException - thrown if the information matching the request cannot be extracted for any reason.
Since:
V2.0
Author:
Ian Brown
Version:
08/03/2004

findChild

public final Rmap findChild(Rmap childI)
                     throws AddressException,
                            SerializeException,
                            IOException,
                            InterruptedException
Finds a matching child Rmap.

If there are multiple matches, the one returned is not defined.

Parameters:
childI - the child Rmap to match.
Returns:
the matching child Rmap.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
09/21/2001

findDescendant

public final Rmap findDescendant(String nameI,
                                 boolean addI)
                          throws AddressException,
                                 SerializeException,
                                 IOException,
                                 InterruptedException
Finds a descendant Rmap by name.

Due to the complications introduced by group membership, this method can only be used properly when there are no groups. If a group is discovered during the search, an exception is thrown.

This method can optionally create the hierarchy leading to the desired descendant.

Parameters:
nameI - the fully qualified descendant's name.
addI - add the descendant if it doesn't exist?
Returns:
the descendant.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
IllegalStateException - thrown if a group is discovered.
Since:
V2.0
Author:
Ian Brown
Version:
08/30/2002

findMember

public final Rmap findMember(Rmap memberI)
                      throws AddressException,
                             SerializeException,
                             IOException,
                             InterruptedException
Finds a matching member Rmap.

If there are multiple matches, the one returned is not defined.

Parameters:
memberI - the member Rmap to match.
Returns:
the matching member Rmap.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
09/21/2001

getChildAt

public Rmap getChildAt(int indexI)
                throws AddressException,
                       SerializeException,
                       EOFException,
                       InterruptedIOException,
                       IOException,
                       InterruptedException
Gets the child at the specified index.

Parameters:
indexI - the index of the child to retrieve.
Returns:
the child Rmap.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
InterruptedIOException - thrown if this operation is interrupted during I/O.
IOException - thrown if there is an error during I/O.
ArrayIndexOutOfBoundsException - thrown if there are no children or the index is not in the range 0 to # of children - 1.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
See Also:
addChild(com.rbnb.api.Rmap), getNchildren()
Author:
Ian Brown
Version:
05/10/2001

getChildren

public final com.rbnb.api.RmapVector getChildren()
                                          throws SerializeException,
                                                 EOFException,
                                                 IOException,
                                                 InterruptedException
Gets the list of children of this Rmap.

Returns:
the children.
Throws:
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
See Also:
addChild(com.rbnb.api.Rmap)
Author:
Ian Brown
Version:
09/21/2001

getDblock

public final DataBlock getDblock()
Gets the DataBlock of this Rmap.

Returns:
the DataBlock.
Since:
V2.0
See Also:
setDblock(DataBlock)
Author:
Ian Brown
Version:
09/21/2001

getFrange

public final TimeRange getFrange()
Gets the frame index TimeRange of this Rmap.

Returns:
the frame index TimeRange.
Since:
V2.0
See Also:
setFrange(TimeRange)
Author:
Ian Brown
Version:
09/21/2001

getFullName

public final String getFullName()
                         throws AddressException,
                                SerializeException,
                                EOFException,
                                IOException,
                                InterruptedException
Gets the fully qualified name of this Rmap.

If the Rmap is a descendent of an Rmap with group members, the fully qualified name is actually ambiguous. The code fills in a special _ name into the fully qualified name at the appropriate point.

Returns:
the fully qualified name.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
02/13/2002

getMemberAt

public Rmap getMemberAt(int indexI)
                 throws AddressException,
                        SerializeException,
                        EOFException,
                        IOException,
                        InterruptedException
Gets the member at the specified index.

Parameters:
indexI - the index of the member to retrieve.
Returns:
the member Rmap.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
ArrayIndexOutOfBoundsException - thrown if there are no members or the index is not in the range 0 to # of members - 1.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
See Also:
addMember(com.rbnb.api.Rmap), getNmembers()
Author:
Ian Brown
Version:
05/10/2001

getMembers

public final com.rbnb.api.RmapVector getMembers()
                                         throws SerializeException,
                                                EOFException,
                                                IOException,
                                                InterruptedException
Gets the group members of this Rmap.

Returns:
the group members.
Throws:
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
See Also:
addMember(com.rbnb.api.Rmap)
Author:
Ian Brown
Version:
09/21/2001

getName

public final String getName()
Gets the name of this Rmap.

Returns:
the name.
Since:
V2.0
See Also:
setName(String)
Author:
Ian Brown
Version:
09/21/2001

getNchildren

public final int getNchildren()
                       throws AddressException,
                              SerializeException,
                              EOFException,
                              IOException,
                              InterruptedException
Gets the number of children.

Returns:
the number of children.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
See Also:
addChild(com.rbnb.api.Rmap), getChildAt(int), removeChild(com.rbnb.api.Rmap)
Author:
Ian Brown
Version:
09/21/2001

getNmembers

public final int getNmembers()
                      throws AddressException,
                             SerializeException,
                             EOFException,
                             IOException,
                             InterruptedException
Gets the number of members.

Returns:
the number of members.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
See Also:
addMember(com.rbnb.api.Rmap), getMemberAt(int), removeMember(com.rbnb.api.Rmap)
Author:
Ian Brown
Version:
09/21/2001

getParent

public final Rmap getParent()
Gets the parent Rmap of this Rmap.

Returns:
the parent Rmap.
Since:
V2.0
Author:
Ian Brown
Version:
09/21/2001

getTrange

public final TimeRange getTrange()
Gets the TimeRange of this Rmap.

Returns:
the TimeRange.
Since:
V2.0
See Also:
setTrange(TimeRange)
Author:
Ian Brown
Version:
09/21/2001

isImplemented

public boolean isImplemented(byte typeI)
                      throws SerializeException,
                             IOException,
                             InterruptedException
Is the specified type of operation implemented?

Rmaps implement everything in Rmap.

Parameters:
typeI - the type of operation.
Returns:
is the operation implemented?
Throws:
SerializeException - thrown if there is a problem with the serialization. For example, a missing bracket.
IOException - thrown if there is an error reading the input stream.
InterruptedException - thrown if the read is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
05/10/2001

markLeaf

public final void markLeaf()
                    throws AddressException,
                           SerializeException,
                           EOFException,
                           InterruptedIOException,
                           IOException,
                           InterruptedException
Marks leaf nodes of an Rmap hierarchy by putting in single byte DataBlocks.

Leaf nodes with DataBlocks are not modified.

Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
InterruptedIOException - thrown if this operation is interrupted during I/O.
IOException - thrown if there is an error during I/O.
ArrayIndexOutOfBoundsException - thrown if there are no children or the index is not in the range 0 to # of children - 1.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
11/20/2002

mergeWith

public final Rmap mergeWith(Rmap rmapI)
                     throws AddressException,
                            SerializeException,
                            EOFException,
                            IOException,
                            InterruptedException
Merges the input Rmap hierarchy with this one.

The merge is done by working through first the group members of each of the two Rmaps and then the children. Matching members and children are merged using a recursive call. New members and children in the input Rmap are added to this Rmap.

If the input Rmap doesn't match this one, then the method tries three things:

  1. if this Rmap is nameless and timeless and the input Rmap is not, but is a root Rmap, the method compares the input Rmap to the children of this Rmap and merges with any match or inserts the input Rmap hierarchy as a new child, or
  2. if the two Rmaps are the roots of their hierarchies and this Rmap is not nameless and timeless, the method creates a new nameless and timeless root Rmap and adds both of the original Rmaps as children,
  3. throws an exception.
    1. The status input Rmap after this method is called depends on what exactly is done, but in general, it shouldn't be used independently.

      Parameters:
      rmapI - the Rmap to merge.
      Returns:
      the merged Rmap (may be this Rmap).
      Throws:
      AddressException - thrown if there is a problem with an address.
      SerializeException - thrown if there is a problem with the serialization.
      EOFException - thrown if the end of the input stream is reached.
      IOException - thrown if there is an error during I/O.
      IllegalArgumentException - thrown if the input Rmap is already a child of another Rmap or if the input is null.
      InterruptedException - thrown if the operation is interrupted.
      Since:
      V2.0
      Author:
      Ian Brown
      Version:
      01/31/2003

moveToBottom

public final Rmap moveToBottom()
                        throws AddressException,
                               SerializeException,
                               EOFException,
                               InterruptedIOException,
                               IOException,
                               InterruptedException
Moves to the bottom of this Rmap hierarchy.

This method is intended for use in conjunction with createFromName. At each point in the hierarchy, it gets the first child and moves down until it reaches an Rmap with no children.

Returns:
the bottom Rmap.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
InterruptedIOException - thrown if this operation is interrupted during I/O.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
See Also:
createFromName(String), moveToTop()
Author:
Ian Brown
Version:
01/28/2002

moveToTop

public final Rmap moveToTop()
Moves to the top of this Rmap hierarchy.

Returns:
the top Rmap.
Since:
V2.0
See Also:
moveToBottom()
Author:
Ian Brown
Version:
01/28/2002

nullify

public void nullify()
Nullifies this Rmap.

This method ensures that all pointers in this DataBlock are cleared, reducing the effort needed by the garbage collector to clean it up.

Since:
V2.2
Author:
Ian Brown
Version:
10/23/2003

removeChild

public void removeChild(Rmap childI)
                 throws AddressException,
                        SerializeException,
                        EOFException,
                        IOException,
                        InterruptedException
Removes a child Rmap from this Rmap.

Parameters:
childI - the child to remove.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
See Also:
addChild(com.rbnb.api.Rmap), getParent(), removeChildAt(int)
Author:
Ian Brown
Version:
05/10/2001

removeChildAt

public void removeChildAt(int indexI)
                   throws AddressException,
                          SerializeException,
                          EOFException,
                          IOException,
                          InterruptedException
Removes the child Rmap at a particular index from this Rmap.

Parameters:
indexI - the index of child to remove.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
See Also:
addChild(com.rbnb.api.Rmap), getParent(), removeChild(com.rbnb.api.Rmap)
Author:
Ian Brown
Version:
08/30/2002

removeMember

public void removeMember(Rmap memberI)
                  throws AddressException,
                         SerializeException,
                         EOFException,
                         IOException,
                         InterruptedException
Removes a member Rmap from this Rmap.

Parameters:
memberI - the member to remove.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
See Also:
addMember(com.rbnb.api.Rmap), getParent(), removeMemberAt(int)
Author:
Ian Brown
Version:
05/10/2001

removeMemberAt

public void removeMemberAt(int indexI)
                    throws AddressException,
                           SerializeException,
                           EOFException,
                           IOException,
                           InterruptedException
Removes the member Rmap at a particular index from this Rmap.

Parameters:
indexI - the index of member to remove.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
See Also:
addMember(com.rbnb.api.Rmap), getParent(), removeMember(com.rbnb.api.Rmap)
Author:
Ian Brown
Version:
08/30/2002

setDblock

public final void setDblock(DataBlock dblockI)
Sets the DataBlock of this Rmap.

Parameters:
dblockI - the DataBlock.
Since:
V2.0
See Also:
getDblock()
Author:
Ian Brown
Version:
09/21/2001

setFrange

public final void setFrange(TimeRange frangeI)
Sets the frame index TimeRange of this Rmap.

Parameters:
frangeI - the frame TimeRange.
Since:
V2.0
See Also:
getFrange()
Author:
Ian Brown
Version:
09/21/2001

setName

public final void setName(String nameI)
                   throws AddressException,
                          SerializeException,
                          EOFException,
                          InterruptedIOException,
                          IOException,
                          InterruptedException
Sets the name of this Rmap.

If the Rmap has a parent Rmap, then changing the name of this Rmap may effect the sort order of its parent's list. To ensure that this change is made properly, this method temporarily removes this Rmap from its parent, updates the name, and adds this Rmap back in to its parent.

Parameters:
nameI - the name of the Rmap.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
InterruptedIOException - thrown if this operation is interrupted during I/O.
IOException - thrown if there is an error during I/O.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
See Also:
getName()
Author:
Ian Brown
Version:
03/28/2003

setTrange

public final void setTrange(TimeRange trangeI)
Sets the TimeRange of this Rmap.

Parameters:
trangeI - the TimeRange.
Since:
V2.0
See Also:
getTrange()
Author:
Ian Brown
Version:
09/21/2001

sortField

public Object sortField(Object sidI)
                 throws com.rbnb.utility.SortException
Gets the sorting value for this Rmap.

The sort identifier for Rmaps is the Rmap itself.

Specified by:
sortField in interface com.rbnb.utility.SortInterface
Parameters:
sidI - the sort type identifier -- must be null.
Returns:
the sort value.
Throws:
com.rbnb.utility.SortException - thrown if the input sort identifier is non-null.
Since:
V2.0
See Also:
compareTo(Object,Object)
Author:
Ian Brown
Version:
05/10/2001

toNameHierarchy

public Rmap toNameHierarchy()
                     throws AddressException,
                            SerializeException,
                            EOFException,
                            IOException,
                            InterruptedException
Creates an Rmap hierarchy that can be used to make requests for the names.

Returns:
the name Rmap hierarchy.
Throws:
AddressException - thrown if there is a problem with an address.
SerializeException - thrown if there is a problem with the serialization.
EOFException - thrown if the end of the input stream is reached.
IOException - thrown if there is an error during I/O.
ArrayIndexOutOfBoundsException - thrown if there are no children or the index is not in the range 0 to # of children - 1.
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
12/21/2001

toString

public String toString()
Gets a displayable string representation of this Rmap.

Overrides:
toString in class Object
Returns:
the string representation.
Since:
V2.0
Author:
Ian Brown
Version:
05/10/2001

toString

public String toString(boolean memberI,
                       String indentI)
                throws InterruptedException
Gets a displayable string representation of this Rmap.

This method is the workhorse that actually does the work under the the standard toString() method. It builds a representation that shows the entire structure of the Rmap, including the group members and the children.

The input parameters specify whether this Rmap is a group member of its parent (or a child) and the identation string to prepend to put this Rmap under its parent.

Parameters:
memberI - is this Rmap a group member?
indentI - the indentation string to use.
Returns:
the string representation.
Throws:
InterruptedException - thrown if the operation is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
05/10/2001

xmlRegistration

public static final String xmlRegistration(long lengthI,
                                           String mimeTypeI)
Produces an XML description of the specified length for the registration map.

Parameters:
lengthI - the length.
mimeTypeI - the MIME type of the data.
Returns:
the XML description.
Since:
V2.0
Author:
Ian Brown
Version:
01/21/2003

xmlRegistration

public static final String xmlRegistration(long lengthI,
                                           String mimeTypeI,
                                           String xmlI)
Produces an XML description of the specified length and the MIME type for the registration map. Additional XML is added if desired.

Parameters:
lengthI - the length.
mimeTypeI - the MIME type of the data.
xmlI - the additional XML to add, if any.
Returns:
the XML description.
Since:
V2.0
Author:
Ian Brown
Version:
01/21/2003