wt.part
Class WTPartUsageLink

java.lang.Object
  extended bywt.fc.WTObject
      extended bywt.fc.ObjectToObjectLink
          extended bywt.vc.struct.IteratedUsageLink
              extended bywt.part.WTPartUsageLink
All Implemented Interfaces:
Archiveable, BinaryLink, BuildableLink, BuildableObject, DisplayIdentification, Externalizable, IBAHolder, Link, NetFactor, ObjectMappable, OccurrenceableLink, Persistable, Serializable, Typed

public class WTPartUsageLink
extends IteratedUsageLink
implements BuildableLink, OccurrenceableLink, Archiveable, Typed, Externalizable

This is an IteratedUsageLink where a specific WTPart uses a WTPartMaster (actually it will use one of the WTParts associated with the WTPartMaster based on a config spec) and the part uses a specific Quantity (with unit of measure) of the part master as a component of its structure.

For example to build a car there are 4 tires for each car built. For a hammock there might be 2 end ropes that are three feet long.

Note that since the link is between a WTPart and a WTPartMaster it will be necessary to use a config spec (usually WTPartConfigSpec) to select the correct version of the WTPartMaster, which is a WTPart.

Use the newWTPartUsageLink static factory method(s), not the WTPartUsageLink constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
vc.config.ConfigSpec, Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
static String LINE_NUMBER
          Label for the attribute.
private  LineNumber lineNumber
           
protected static long OLD_FORMAT_VERSION_UID
           
private  Quantity quantity
           
static String QUANTITY
          Label for the attribute.
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  BuildReference sourceIdentification
           
private  AttributeContainer theAttributeContainer
           
private  TypeDefinitionReference typeDefinitionReference
           
static String USED_BY_ROLE
          Label for the attribute.
static String USES_ROLE
          Label for the attribute.
private  Vector usesOccurrenceVector
           
 
Fields inherited from class wt.fc.ObjectToObjectLink
ROLE_AOBJECT_REF, ROLE_BOBJECT_REF
 
Fields inherited from class wt.fc.WTObject
CREATE_TIMESTAMP, MODIFY_TIMESTAMP
 
Fields inherited from interface wt.build.BuildableLink
BUILD_TARGET_ROLE, PERSISTABLE_ROLE
 
Fields inherited from interface wt.fc.BinaryLink
ALL_ROLES, BOTH_ROLES, ROLE_AOBJECT_REF, ROLE_AOBJECT_ROLE, ROLE_BOBJECT_REF, ROLE_BOBJECT_ROLE
 
Fields inherited from interface wt.fc.Persistable
IDENTITY, PERSIST_INFO, TYPE
 
Fields inherited from interface wt.build.BuildableObject
SOURCE_IDENTIFICATION
 
Fields inherited from interface wt.occurrence.OccurrenceableLink
USES_OCCURRENCE_VECTOR
 
Fields inherited from interface wt.type.Typed
TYPE_DEFINITION_REFERENCE
 
Fields inherited from interface wt.iba.value.IBAHolder
ATTRIBUTE_CONTAINER
 
Fields inherited from interface wt.identity.DisplayIdentification
DISPLAY_IDENTIFIER, DISPLAY_IDENTITY, DISPLAY_TYPE
 
Constructor Summary
WTPartUsageLink()
           
 
Method Summary
 boolean equals(Object obj)
          Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifiers.
 AttributeContainer getAttributeContainer()
          Gets the object for the association that plays role: ATTRIBUTE_CONTAINER.
 BuildTarget getBuildTarget()
          Gets the object for the association that plays role: BUILD_TARGET_ROLE.
 String getConceptualClassname()
          Deprecated.  
 LineNumber getLineNumber()
          Gets the object for the association that plays role: LINE_NUMBER.
 Persistable getPersistable()
          Gets the object for the association that plays role: PERSISTABLE_ROLE.
 Quantity getQuantity()
          Gets the object for the association that plays role: QUANTITY.
 BuildReference getSourceIdentification()
          Gets the object for the association that plays role: SOURCE_IDENTIFICATION.
 TypeDefinitionReference getTypeDefinitionReference()
          Gets the object for the association that plays role: TYPE_DEFINITION_REFERENCE.
 Vector getUsesOccurrenceVector()
          Gets the value of the attribute: USES_OCCURRENCE_VECTOR.
 int hashCode()
          Returns a hash code for this object based upon its ObjectIdentifier.
protected  void initialize(Persistable aObj, Persistable bObj)
          Default initializer for Link objects.
static WTPartUsageLink newWTPartUsageLink(WTPart usedBy, WTPartMaster uses)
          Default factory for the class.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
 void readExternal(PersistentRetrieveIfc input)
          Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(WTPartUsageLink thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setAttributeContainer(AttributeContainer a_AttributeContainer)
          Sets the object for the association that plays role: ATTRIBUTE_CONTAINER.
 void setBuildTarget(BuildTarget theBuildTarget)
          Sets the object for the association that plays role: BUILD_TARGET_ROLE.
 void setLineNumber(LineNumber a_LineNumber)
          Sets the object for the association that plays role: LINE_NUMBER.
 void setPersistable(Persistable thePersistable)
          Sets the object for the association that plays role: PERSISTABLE_ROLE.
 void setQuantity(Quantity a_Quantity)
          Sets the object for the association that plays role: QUANTITY.
 void setSourceIdentification(BuildReference a_SourceIdentification)
          Sets the object for the association that plays role: SOURCE_IDENTIFICATION.
 void setTypeDefinitionReference(TypeDefinitionReference a_TypeDefinitionReference)
          Sets the object for the association that plays role: TYPE_DEFINITION_REFERENCE.
 void setUsedBy(Iterated usedBy)
          Sets the object for the association that plays role: USED_BY_ROLE.
 void setUses(Mastered uses)
          Sets the object for the association that plays role: USES_ROLE.
 void setUsesOccurrenceVector(Vector a_UsesOccurrenceVector)
          Sets the value of the attribute: USES_OCCURRENCE_VECTOR.
private  void typeDefinitionReferenceValidate(TypeDefinitionReference a_TypeDefinitionReference)
           
protected  void validate()
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 void writeExternal(PersistentStoreIfc output)
          Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.
 
Methods inherited from class wt.vc.struct.IteratedUsageLink
getUsedBy, getUses, readVersion
 
Methods inherited from class wt.fc.ObjectToObjectLink
appendJoinCriteria, appendRoleCriteria, duplicate, getAllObjects, getJoinValues, getLinkInfo, getObject, getOtherObject, getRemoteRoleAObjectId, getRemoteRoleBObjectId, getRole, getRoleAObject, getRoleAObjectId, getRoleAObjectRef, getRoleBObject, getRoleBObjectId, getRoleBObjectRef, getRoleIdName, getRoleObject, isRoleANonpersistentProxy, isRoleBNonpersistentProxy, readVersion, setRoleAObject, setRoleAObjectRef, setRoleBObject, setRoleBObjectRef, setRoleObject
 
Methods inherited from class wt.fc.WTObject
checkAttributes, finalize, getClassInfo, getCreateTimestamp, getDisplayIdentifier, getDisplayIdentity, getDisplayType, getIdentity, getModifyTimestamp, getPersistInfo, getType, initialize, readVersion, setPersistInfo, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wt.fc.BinaryLink
getLinkInfo, getObject, getOtherObject, getRole, getRoleAObject, getRoleAObjectId, getRoleAObjectRef, getRoleBObject, getRoleBObjectId, getRoleBObjectRef, setRoleAObject, setRoleAObjectRef, setRoleBObject, setRoleBObjectRef
 
Methods inherited from interface wt.fc.Link
appendJoinCriteria, appendRoleCriteria, getAllObjects, getJoinValues, getRoleIdName, getRoleObject, setRoleObject
 
Methods inherited from interface wt.fc.Persistable
checkAttributes, getIdentity, getPersistInfo, getType, setPersistInfo
 
Methods inherited from interface wt.fc.NetFactor
getClassInfo
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

USED_BY_ROLE

public static final String USED_BY_ROLE
Label for the attribute.

Supported API: true

See Also:
Constant Field Values

USES_ROLE

public static final String USES_ROLE
Label for the attribute.

Supported API: true

See Also:
Constant Field Values

QUANTITY

public static final String QUANTITY
Label for the attribute.

Supported API: true

See Also:
Constant Field Values

quantity

private Quantity quantity

LINE_NUMBER

public static final String LINE_NUMBER
Label for the attribute.

Supported API: true

See Also:
Constant Field Values

lineNumber

private LineNumber lineNumber

sourceIdentification

private BuildReference sourceIdentification

usesOccurrenceVector

private Vector usesOccurrenceVector

typeDefinitionReference

private TypeDefinitionReference typeDefinitionReference

theAttributeContainer

private AttributeContainer theAttributeContainer

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values
Constructor Detail

WTPartUsageLink

public WTPartUsageLink()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class IteratedUsageLink
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class IteratedUsageLink
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(WTPartUsageLink thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(PersistentStoreIfc output)
                   throws SQLException,
                          DatastoreException
Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
writeExternal in interface ObjectMappable
Overrides:
writeExternal in class IteratedUsageLink
Parameters:
output -
Throws:
SQLException
DatastoreException

readExternal

public void readExternal(PersistentRetrieveIfc input)
                  throws SQLException,
                         DatastoreException
Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
readExternal in interface ObjectMappable
Overrides:
readExternal in class IteratedUsageLink
Parameters:
input -
Throws:
SQLException
DatastoreException

getBuildTarget

public BuildTarget getBuildTarget()
Gets the object for the association that plays role: BUILD_TARGET_ROLE.

Supported API: false

Specified by:
getBuildTarget in interface BuildableLink
Returns:
BuildTarget

setBuildTarget

public void setBuildTarget(BuildTarget theBuildTarget)
                    throws WTPropertyVetoException
Sets the object for the association that plays role: BUILD_TARGET_ROLE.

Supported API: false

Specified by:
setBuildTarget in interface BuildableLink
Parameters:
theBuildTarget -
Throws:
WTPropertyVetoException

getPersistable

public Persistable getPersistable()
Gets the object for the association that plays role: PERSISTABLE_ROLE.

Supported API: false

Specified by:
getPersistable in interface BuildableLink
Returns:
Persistable

setPersistable

public void setPersistable(Persistable thePersistable)
                    throws WTPropertyVetoException
Sets the object for the association that plays role: PERSISTABLE_ROLE.

Supported API: false

Specified by:
setPersistable in interface BuildableLink
Parameters:
thePersistable -
Throws:
WTPropertyVetoException

setUsedBy

public void setUsedBy(Iterated usedBy)
               throws WTPropertyVetoException
Sets the object for the association that plays role: USED_BY_ROLE.

Supported API: true

Overrides:
setUsedBy in class IteratedUsageLink
Parameters:
usedBy -
Throws:
WTPropertyVetoException

setUses

public void setUses(Mastered uses)
             throws WTPropertyVetoException
Sets the object for the association that plays role: USES_ROLE.

Supported API: true

Overrides:
setUses in class IteratedUsageLink
Parameters:
uses -
Throws:
WTPropertyVetoException

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Returns:
String

getQuantity

public Quantity getQuantity()
Gets the object for the association that plays role: QUANTITY.

Supported API: true

Returns:
Quantity

setQuantity

public void setQuantity(Quantity a_Quantity)
Sets the object for the association that plays role: QUANTITY.

Supported API: true

Parameters:
a_Quantity -

getLineNumber

public LineNumber getLineNumber()
Gets the object for the association that plays role: LINE_NUMBER.

Supported API: true

Returns:
LineNumber

setLineNumber

public void setLineNumber(LineNumber a_LineNumber)
                   throws WTPropertyVetoException
Sets the object for the association that plays role: LINE_NUMBER.

Supported API: true

Parameters:
a_LineNumber -
Throws:
WTPropertyVetoException

initialize

protected void initialize(Persistable aObj,
                          Persistable bObj)
                   throws WTException
Default initializer for Link objects.

Supported API: false

Overrides:
initialize in class ObjectToObjectLink
Parameters:
aObj -
bObj -
Throws:
WTException

newWTPartUsageLink

public static WTPartUsageLink newWTPartUsageLink(WTPart usedBy,
                                                 WTPartMaster uses)
                                          throws WTException
Default factory for the class.

Supported API: false

Parameters:
usedBy -
uses -
Returns:
WTPartUsageLink
Throws:
WTException

getSourceIdentification

public BuildReference getSourceIdentification()
Gets the object for the association that plays role: SOURCE_IDENTIFICATION.

Supported API: false

Specified by:
getSourceIdentification in interface BuildableObject
Returns:
BuildReference

setSourceIdentification

public void setSourceIdentification(BuildReference a_SourceIdentification)
                             throws WTPropertyVetoException
Sets the object for the association that plays role: SOURCE_IDENTIFICATION.

Supported API: false

Specified by:
setSourceIdentification in interface BuildableObject
Parameters:
a_SourceIdentification -
Throws:
WTPropertyVetoException

getUsesOccurrenceVector

public Vector getUsesOccurrenceVector()
Gets the value of the attribute: USES_OCCURRENCE_VECTOR. Each element of this non-persistent Vector contains UsesOccurrences, each of which may contain a PathOccurrence. Note that any implementation of this interface must provide server-side APIs that specifically populate this Vector, otherwise it will be null.

Supported API: true

Specified by:
getUsesOccurrenceVector in interface OccurrenceableLink
Returns:
Vector

setUsesOccurrenceVector

public void setUsesOccurrenceVector(Vector a_UsesOccurrenceVector)
Sets the value of the attribute: USES_OCCURRENCE_VECTOR. Each element of this non-persistent Vector contains UsesOccurrences, each of which may contain a PathOccurrence. Note that any implementation of this interface must provide server-side APIs that specifically populate this Vector, otherwise it will be null.

Supported API: true

Specified by:
setUsesOccurrenceVector in interface OccurrenceableLink
Parameters:
a_UsesOccurrenceVector -

getTypeDefinitionReference

public TypeDefinitionReference getTypeDefinitionReference()
Gets the object for the association that plays role: TYPE_DEFINITION_REFERENCE.

Supported API: false

Specified by:
getTypeDefinitionReference in interface Typed
Returns:
TypeDefinitionReference

setTypeDefinitionReference

public void setTypeDefinitionReference(TypeDefinitionReference a_TypeDefinitionReference)
                                throws WTPropertyVetoException
Sets the object for the association that plays role: TYPE_DEFINITION_REFERENCE.

Supported API: false

Specified by:
setTypeDefinitionReference in interface Typed
Parameters:
a_TypeDefinitionReference -
Throws:
WTPropertyVetoException

typeDefinitionReferenceValidate

private void typeDefinitionReferenceValidate(TypeDefinitionReference a_TypeDefinitionReference)
                                      throws WTPropertyVetoException
Parameters:
a_TypeDefinitionReference -
Throws:
WTPropertyVetoException

getAttributeContainer

public AttributeContainer getAttributeContainer()
Gets the object for the association that plays role: ATTRIBUTE_CONTAINER.

Supported API: false

Specified by:
getAttributeContainer in interface IBAHolder
Returns:
AttributeContainer

setAttributeContainer

public void setAttributeContainer(AttributeContainer a_AttributeContainer)
Sets the object for the association that plays role: ATTRIBUTE_CONTAINER.

Supported API: false

Specified by:
setAttributeContainer in interface IBAHolder
Parameters:
a_AttributeContainer -

equals

public boolean equals(Object obj)
Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifiers. Changed or stale copies are still considered equal by this method. Delegates to PersistenceHelper.equals(Persistable,Object).

Warning: Certain core Windchill operations may depend upon equals being ObjectIdentifier-based. Changes to the default implementation should be done with care, if at all.

Supported API: false

Overrides:
equals in class IteratedUsageLink
Parameters:
obj -
Returns:
boolean

hashCode

public int hashCode()
Returns a hash code for this object based upon its ObjectIdentifier. Delegates to PersistenceHelper.hashCode(Persistable).

Warning: Certain core Windchill operations may depend upon hashCode being ObjectIdentifier-based. Changes to the default implementation should be done with care, if at all.

Supported API: false

Overrides:
hashCode in class IteratedUsageLink
Returns:
int

validate

protected void validate()
                 throws WTException
Throws:
WTException