wt.clients.prodmgmt
Class UsageMasterItem

java.lang.Object
  extended bywt.clients.prodmgmt.UsageMasterItem
All Implemented Interfaces:
Explorable, Identifiable, ReferenceHolder

public class UsageMasterItem
extends Object
implements Explorable

UsageMasterItem is a model class for manipulating WTPartUsageLinks.

UsageMasterItem implements the wt.explorer.Explorable interface to allow for use in the WTExplorer.

It contains many methods which it delegates to the contained uses PartMasterItem to allow for easy integration with the PartExplorer.



Supported API: false

Extendable: false

See Also:
WTExplorer, PartMasterItem, PartExplorer, WTPartUsageLink

Field Summary
private  String id
           
private  long lineNumber
           
private  boolean modified
           
private static int newUsageCounter
           
private  double quantity
           
private  QuantityUnit unit
           
private  WTPartUsageLink usageLink
           
private  PartMasterItem uses
           
 
Constructor Summary
UsageMasterItem()
          Create an empty usage item.
UsageMasterItem(PartMasterItem uses, WTPartUsageLink usage_link)
          Create a usage item between the specified part items using the specified usage link.
 
Method Summary
 Explorable[] getContents()
          Return the contents of the uses part item
 String getId()
          Get an identifier for this object.
 String getIdentity()
          Return the identity icon of the uses part item
 String getLastUpdatedDate()
          Returns the date on which this part was last updated.
 long getLineNumber()
          Get the line number amount in the usage link
 String getLineNumberString()
           
 String getName()
          Get the name of the uses part.
 String getNumber()
          Get the number of the uses part.
 Object getObject()
          Get the contained object.
 Image getOpenIcon()
          Return the open icon of the uses part item
 WTPartUsageLink getPartUsageLink()
          Get the contained usage link.
 double getQuantity()
          Get the quantity amount in the usage link
 String getQuantityString()
           
 Image getStandardIcon()
          Gets the image to display for this object.
 String getUniqueIdentity()
          Return the unique identity icon of the uses part item
 String getUnitName()
          Get a string representation of the units
 QuantityUnit getUnits()
          Get the units for the quantity.
 Explorable[] getUses()
          Return the objects used by the uses part item.
 PartMasterItem getUsesPart()
          Get the uses part item
 boolean isModified()
          Return the modified flag
 void setLineNumber(long a_lineNumber)
          Set the line number in the usage link.
 void setModified(boolean modified_flag)
          Set the modified flag.
 void setObject(Object obj)
          Set the contained object.
 void setPartUsageLink(WTPartUsageLink usage_link)
          Set the contained usage link.
 void setQuantity(double a_quantity)
          Set the quantity amount in the usage link.
 void setUnit(QuantityUnit a_unit)
          Set the units for the quantity.
 void setUses(PartMasterItem uses)
          Set the uses part item.
 String toString()
          Return a string with debug information
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

usageLink

private WTPartUsageLink usageLink

newUsageCounter

private static int newUsageCounter

modified

private boolean modified

id

private String id

quantity

private double quantity

unit

private QuantityUnit unit

lineNumber

private long lineNumber

uses

private PartMasterItem uses
Constructor Detail

UsageMasterItem

public UsageMasterItem()
Create an empty usage item.


UsageMasterItem

public UsageMasterItem(PartMasterItem uses,
                       WTPartUsageLink usage_link)
Create a usage item between the specified part items using the specified usage link.

Parameters:
uses - the uses part
usage_link - the actual usage link
Method Detail

setModified

public void setModified(boolean modified_flag)
Set the modified flag.

Parameters:
modified_flag - the new value for the modified flag

isModified

public boolean isModified()
Return the modified flag

Returns:
true if modified

setPartUsageLink

public void setPartUsageLink(WTPartUsageLink usage_link)
Set the contained usage link.

Parameters:
usage_link - the usage link to contain.

getPartUsageLink

public WTPartUsageLink getPartUsageLink()
Get the contained usage link.

Returns:
the contained usage link

setUses

public void setUses(PartMasterItem uses)
Set the uses part item.

Parameters:
uses - the uses part item

getUsesPart

public PartMasterItem getUsesPart()
Get the uses part item

Returns:
the uses part item

getId

public String getId()
Get an identifier for this object.

Returns:
an identifying string

setQuantity

public void setQuantity(double a_quantity)
Set the quantity amount in the usage link.

Parameters:
a_quantity - the amount

getQuantityString

public String getQuantityString()

getQuantity

public double getQuantity()
Get the quantity amount in the usage link

Returns:
the quantity amount in the link

setLineNumber

public void setLineNumber(long a_lineNumber)
Set the line number in the usage link.


getLineNumberString

public String getLineNumberString()

getLineNumber

public long getLineNumber()
Get the line number amount in the usage link

Returns:
the line number amount in the link

setUnit

public void setUnit(QuantityUnit a_unit)
Set the units for the quantity.

Parameters:
a_unit - the unit to use

getUnits

public QuantityUnit getUnits()
Get the units for the quantity.

Returns:
the units for the quantity

getUnitName

public String getUnitName()
Get a string representation of the units

Returns:
a string representation of the units.

toString

public String toString()
Return a string with debug information

Returns:
a string with debug information

getUses

public Explorable[] getUses()
                     throws WTException
Return the objects used by the uses part item.

Specified by:
getUses in interface Explorable
Returns:
an array of used objects
Throws:
WTException
See Also:
WTException

getStandardIcon

public Image getStandardIcon()
Description copied from interface: Identifiable
Gets the image to display for this object.

Specified by:
getStandardIcon in interface Identifiable
Returns:
the image to display for this object.

getOpenIcon

public Image getOpenIcon()
Return the open icon of the uses part item

Specified by:
getOpenIcon in interface Identifiable
Returns:
the open icon of the uses part item

getIdentity

public String getIdentity()
Return the identity icon of the uses part item

Specified by:
getIdentity in interface Identifiable
Returns:
the identity icon of the uses part item

getUniqueIdentity

public String getUniqueIdentity()
Return the unique identity icon of the uses part item

Specified by:
getUniqueIdentity in interface Identifiable
Returns:
the unique identity icon of the uses part item

getContents

public Explorable[] getContents()
                         throws WTException
Return the contents of the uses part item

Specified by:
getContents in interface Explorable
Returns:
an array of contents of the uses part item
Throws:
WTException
See Also:
WTException

setObject

public void setObject(Object obj)
Set the contained object.

Implements the ReferenceHolder interface.

Specified by:
setObject in interface ReferenceHolder
Parameters:
obj - the contained object

getObject

public Object getObject()
Get the contained object.

Implements the ReferenceHolder interface.

Specified by:
getObject in interface ReferenceHolder
Returns:
the contained object

getName

public String getName()
Get the name of the uses part.

Returns:
the name of the uses part.

getNumber

public String getNumber()
Get the number of the uses part.

Returns:
the number of the uses part.

getLastUpdatedDate

public String getLastUpdatedDate()
Returns the date on which this part was last updated.