com.ptc.windchill.esi.bom
Class AlternateItemGroupMgr

java.lang.Object
  extended bycom.ptc.windchill.esi.bom.AlternateItemGroupMgr
All Implemented Interfaces:
Externalizable, Serializable

public final class AlternateItemGroupMgr
extends Object
implements Externalizable

Provides generally useful methods to create, delete, and.or access AlternateItemGroup objects.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static int AIGID_UPPER_LIMIT
           
private static char[] base36Chars
           
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
private static ArrayList IDs
           
private static int MAX
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
 
Constructor Summary
AlternateItemGroupMgr()
           
 
Method Summary
private  int assignID(WTPart bom, PartUsageInfo pui)
           
 AlternateItemGroup createAlternateItemGroup(WTPart assembly, PartUsageInfo partUsageInfo)
          Create an AlternateItemGroup object in database based upon the given part usage info.
 boolean existAIG(WTPart assembly, PartUsageInfo pui)
           
private  AlternateItemGroup findAlternateItemGroup(WTPartMaster bomMaster, long lineNumber)
          Find an AlternateItemGroup with the given linenumber and roleA has the given master.
private  AlternateItemGroup findAlternateItemGroup(WTPartMaster bomMaster, WTPartMaster roleB)
          Find an AlternateItemGroup with the given roleB and roleA has the given master.
private static void generateIDs()
           
 int getAIGNumber(AlternateItemGroup aig)
          Returns an AlternateItemGroup id.
 AlternateItemGroup getAlternateItemGroup(WTPart assembly, PartUsageInfo partUsageInfo)
          Returns an alternate item group, if one exists in the database.
 AlternateItemGroup getAlternateItemGroup(WTPart assembly, WTPartMaster component, LineNumber lineNumber)
          Returns an alternate item group , if with line number , based upon an assembly part and line number, otherwise considering as consolidated usage links, means that only one association between an assembly and more than one same components

Supported API: true
protected  String getAlternateItemGroupID(AlternateItemGroup aig)
          Returns string to represent alternate item group identifier
 String getAlternateItemGroupID(WTPart bom, PartUsageInfo pui)
           
 Collection getAlternateItemGroups(WTPart assembly)
          Returns a collection of alternate item groups for an assembly.
private  int getNewID(WTPart bom)
           
 WTPartUsageLink getUsageLink(WTPart bom, LineNumber lineNumber)
           
 boolean hasSubstitutes(WTPart assembly, PartUsageInfo partUsageInfo)
          Checks if substitutes exist on a part usage link.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
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(AlternateItemGroupMgr thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 boolean withLineNumbers(PartUsageInfo pui)
          The input of part usage info ensured that there is no mix of with line numbers and without line numbers exsit in one assebmbly
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
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

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

base36Chars

private static final char[] base36Chars

MAX

private static int MAX

IDs

private static ArrayList IDs

AIGID_UPPER_LIMIT

private static final int AIGID_UPPER_LIMIT
Constructor Detail

AlternateItemGroupMgr

public AlternateItemGroupMgr()
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
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
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(AlternateItemGroupMgr 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

createAlternateItemGroup

public AlternateItemGroup createAlternateItemGroup(WTPart assembly,
                                                   PartUsageInfo partUsageInfo)
Create an AlternateItemGroup object in database based upon the given part usage info.

Supported API: true

Parameters:
assembly - The assembly part which defines the product structure (BOM) to which the AIG is to be associated.
partUsageInfo - The PartUsageInfo object that contains the part usage link information necessary to create an AIG.
Returns:
AlternateItemGroup

getAlternateItemGroups

public Collection getAlternateItemGroups(WTPart assembly)
Returns a collection of alternate item groups for an assembly.

Supported API: true

Parameters:
assembly - The assembly part.
Returns:
Collection

getAlternateItemGroup

public AlternateItemGroup getAlternateItemGroup(WTPart assembly,
                                                PartUsageInfo partUsageInfo)
Returns an alternate item group, if one exists in the database. Uses a WTPart to identify the assembly. Uses a PartUsageInfo to identify the line number and component on the assembly.

Supported API: true

Parameters:
assembly - The assmbly part.
partUsageInfo - The PartUsageInfo object that contains the part usage link information necessary to identify an existing AIG.
Returns:
AlternateItemGroup

getAlternateItemGroup

public AlternateItemGroup getAlternateItemGroup(WTPart assembly,
                                                WTPartMaster component,
                                                LineNumber lineNumber)
Returns an alternate item group , if with line number , based upon an assembly part and line number, otherwise considering as consolidated usage links, means that only one association between an assembly and more than one same components

Supported API: true

Parameters:
assembly - The assembly part.
component - The component part.
lineNumber - The line number for a WTPartUsageLink.
Returns:
AlternateItemGroup

hasSubstitutes

public boolean hasSubstitutes(WTPart assembly,
                              PartUsageInfo partUsageInfo)
Checks if substitutes exist on a part usage link.

Supported API: true

Parameters:
assembly - The assemblly part object.
partUsageInfo - The part usage info for the assembly.
Returns:
boolean

getAIGNumber

public int getAIGNumber(AlternateItemGroup aig)
Returns an AlternateItemGroup id.

Supported API: true

Parameters:
aig -
Returns:
int

getNewID

private int getNewID(WTPart bom)

generateIDs

private static void generateIDs()

getUsageLink

public WTPartUsageLink getUsageLink(WTPart bom,
                                    LineNumber lineNumber)

withLineNumbers

public boolean withLineNumbers(PartUsageInfo pui)
The input of part usage info ensured that there is no mix of with line numbers and without line numbers exsit in one assebmbly


existAIG

public boolean existAIG(WTPart assembly,
                        PartUsageInfo pui)

getAlternateItemGroupID

protected String getAlternateItemGroupID(AlternateItemGroup aig)
Returns string to represent alternate item group identifier


getAlternateItemGroupID

public String getAlternateItemGroupID(WTPart bom,
                                      PartUsageInfo pui)

assignID

private int assignID(WTPart bom,
                     PartUsageInfo pui)

findAlternateItemGroup

private AlternateItemGroup findAlternateItemGroup(WTPartMaster bomMaster,
                                                  long lineNumber)
Find an AlternateItemGroup with the given linenumber and roleA has the given master. Only be called with lineNumber.


findAlternateItemGroup

private AlternateItemGroup findAlternateItemGroup(WTPartMaster bomMaster,
                                                  WTPartMaster roleB)
Find an AlternateItemGroup with the given roleB and roleA has the given master. Only be called if without Line number.