wt.part
Class BOMPartsListVisitor

java.lang.Object
  extended bywt.visitor.VisitorAdapter
      extended bywt.visitor.TextOutputVisitor
          extended bywt.part.BOMPartsListVisitor
All Implemented Interfaces:
Serializable, Visitor
Direct Known Subclasses:
HtmlPreformattedPartsListVisitor, HtmlTabularPartsListVisitor

public abstract class BOMPartsListVisitor
extends TextOutputVisitor
implements Serializable

This class is a Visitor that maintains a list of parts (nodes) as the structure is navigated. The usage information (links) is maintained internally. After navigation is complete, the parts list table represents the entire list of parts that make up the structure. Only parts that do not use any other parts (i.e. leaf nodes) are included. The keys in this table are the part identities and the associated value is the usage information.

Supported API: true

Extendable: true

See Also:
Serialized Form

Field Summary
private  Hashtable assemblies
           
private static String CLASSNAME
           
private  Hashtable partsList
           
private static int PRODUCT
           
private static String RESOURCE
           
private static int SUM
           
 
Fields inherited from class wt.visitor.TextOutputVisitor
 
Constructor Summary
BOMPartsListVisitor()
           
 
Method Summary
 Hashtable getConsolidatedPartsList()
           
private  Object getLinkAttributes(Link link)
          This method gets the attributes for this link.
private  Object getParentNodeAttributes(Persistable node)
          This method gets the attributes for this node.
 Hashtable getPartsList()
          Gets the object for the association that plays role: partsList.
private  Object processAttributes(Object previousAttributes, Object attributes, int operation)
          This method processes the previous and current attributes as specified by the operation parameter.
abstract  void report()
          This operation outputs a text report of the internal parts list.
 boolean visit(Persistable fromNode, Link link, Persistable toNode, int level, boolean previouslyVisited)
          Visit a node.
 
Methods inherited from class wt.visitor.TextOutputVisitor
getLocale, getPrintWriter, getResourceBundle, printLocalizedMessage, printLocalizedMessage, printLocalizedMessage, setLocale, setPrintWriter, setPrintWriter, setResourceBundle
 
Methods inherited from class wt.visitor.VisitorAdapter
visitLevel, visitLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

partsList

private Hashtable partsList

assemblies

private Hashtable assemblies

SUM

private static final int SUM
See Also:
Constant Field Values

PRODUCT

private static final int PRODUCT
See Also:
Constant Field Values
Constructor Detail

BOMPartsListVisitor

public BOMPartsListVisitor()
Method Detail

getPartsList

public Hashtable getPartsList()
Gets the object for the association that plays role: partsList.

Supported API: true

Returns:
Hashtable

visit

public final boolean visit(Persistable fromNode,
                           Link link,
                           Persistable toNode,
                           int level,
                           boolean previouslyVisited)
                    throws WTException
Visit a node. Information is stored in an internal hash table for this link and node. A boolean true value is always returned so that every node is visited.

Supported API: true

Specified by:
visit in interface Visitor
Overrides:
visit in class VisitorAdapter
Parameters:
fromNode -
link -
toNode -
level -
previouslyVisited -
Returns:
boolean
Throws:
WTException

report

public abstract void report()
This operation outputs a text report of the internal parts list. This operation should only be called after navigation is complete.

Supported API: true


getParentNodeAttributes

private Object getParentNodeAttributes(Persistable node)
                                throws WTException
This method gets the attributes for this node.

Throws:
WTException

getLinkAttributes

private Object getLinkAttributes(Link link)
                          throws WTException
This method gets the attributes for this link.

Throws:
WTException

processAttributes

private Object processAttributes(Object previousAttributes,
                                 Object attributes,
                                 int operation)
                          throws WTException
This method processes the previous and current attributes as specified by the operation parameter.

Throws:
WTException

getConsolidatedPartsList

public Hashtable getConsolidatedPartsList()