All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface uhr.core.structure.PartReader

public interface PartReader
extends Replicatable
This interface allows reading parts from a cell. It acts as a cell Fascade. (More methods will be added)

The PartUser implementation should get its Cell for use in getting parts.


Method Index

 o enumeratePartNames()
Returns an Enumeration of the part names in the cell, in order.
 o findPart(String)
Finds and returns the named part or throws an IllegalStateException if not found.
 o getPart(String)
Returns the named part in the cell or throws an IllegalStateException if none.
 o getPartCount()
Returns the number of parts in the cell.
 o listTree(boolean, boolean)
Returns a String representing nodes in the the System Tree.

Methods

 o findPart
 public abstract Object findPart(String partName)
Finds and returns the named part or throws an IllegalStateException if not found. Can find "local" or "inherited" parts. If the part is not found in the cell, an upward search is made until the root cell is encountered. These are the cases:

1. The part is found in the cell and returned. Note it may be a local or inheritable part.

2. The part is never found, so the exception is thrown.

3. The part is found upwardly, is an inheritable part and is returned.

4. The part is found upwardly but is not an inheritable part, and so the exception is thrown.

A special case is when the cell is needed. Since this usually has a custom name, the reserved partName "MyCell" can be used to get the cell the PartReader is in.

A possible feature is if the partName contains slashes, we look downward for it in a standard file path manner. We frown on this because it creates tight location dependencies.

Parameters:
partName - the name of the part to find.
Returns:
the part found.
 o getPart
 public abstract Object getPart(String partName)
Returns the named part in the cell or throws an IllegalStateException if none. Use findPart(String name) instead, except for rare cases of restricting the search to the cell. Using findPart allows the designer to move parts upward or downward in the System Tree, for greater or lesser reuse via the "inherited part" mechanism, as time goes by.

Parameters:
partName - the name of the part to retrieve.
Returns:
the part in the cell with that name.
 o enumeratePartNames
 public abstract Enumeration enumeratePartNames()
Returns an Enumeration of the part names in the cell, in order.

Returns:
the part names in the cell.
 o getPartCount
 public abstract int getPartCount()
Returns the number of parts in the cell.

Returns:
the number of parts in the cell.
 o listTree
 public abstract String listTree(boolean startAtRoot,
                                 boolean includeHidden)
Returns a String representing nodes in the the System Tree. Format is one line per node with indentation. This is for developement use.

Parameters:
startAtRoot - true to start at the root or false to start at the cell this PartReader is in.
includeHidden - true to include hidden nodes or false to not include them.
Returns:
a String representing the System Tree.

All Packages  Class Hierarchy  This Package  Previous  Next  Index