com.ptc.windchill.enterprise.part.structure
Class PartStructureFindNumberComparator

java.lang.Object
  extended by com.ptc.windchill.enterprise.part.structure.PartStructureFindNumberComparator
All Implemented Interfaces:
Comparator

public class PartStructureFindNumberComparator
extends Object
implements Comparator

This Comparator can be used to compare the Find Number attribute of item 1 of an array, which should be a WTPartUsageLink, delegating the comparison to a sub-Comparator if neither object has a Find Number. Note that using this Comparator in a sort will result in all items without Find Numbers coming at the end.

Supported API: true

Extendable: false


Constructor Summary
PartStructureFindNumberComparator(Comparator subComparator)
          This constructor needs a subComparator to delegate the comparison to when it cannot perform the comparison itself.
 
Method Summary
 int compare(Object o1, Object o2)
          Compares the value of the Find Number attribute of wt.part.WTPartUsageLinkss using the getFindNumber method to extract the Find Numbers from the link objects and delegating the comparison to the sub-Comparator if neither object has a Find Number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

PartStructureFindNumberComparator

public PartStructureFindNumberComparator(Comparator subComparator)
This constructor needs a subComparator to delegate the comparison to when it cannot perform the comparison itself. For instance when neither has a FindNumber then the sub-Comparator, which might just compare based on Name or Number of the part, would be used.

Supported API: true

Extendable: false

Method Detail

compare

public int compare(Object o1,
                   Object o2)
Compares the value of the Find Number attribute of wt.part.WTPartUsageLinkss using the getFindNumber method to extract the Find Numbers from the link objects and delegating the comparison to the sub-Comparator if neither object has a Find Number.

Supported API: true

Extendable: false

Specified by:
compare in interface Comparator