/* bcwti
 *
 * Copyright (c) 2010 Parametric Technology Corporation (PTC). All Rights Reserved.
 *
 * This software is the confidential and proprietary information of PTC
 * and is subject to the terms of a software license agreement. You shall
 * not disclose such confidential information and shall use it only in accordance
 * with the terms of the license agreement.
 *
 * ecwti
 */

package com.ptc.windchill.esi.examples;

import wt.part.LineNumber;
import wt.part.PartUsageInfo;
import wt.part.WTPartUsageLink;

import wt.util.WTException;

public class Example4MyPartUsageInfo
   extends PartUsageInfo
{
   protected boolean isDifferent(PartUsageInfo info)
   {
      boolean result = super.isDifferent(info);

      if (result == false)
      {
         Example4MyPartUsageInfo other = (Example4MyPartUsageInfo)info;

         WTPartUsageLink thisLink = this.getPartUsageLink();
         WTPartUsageLink otherLink = other.getPartUsageLink();

         LineNumber thisLine = thisLink.getLineNumber();
         LineNumber otherLine = otherLink.getLineNumber();

         if (thisLine == null)
         {
            if (otherLine != null)
            {
               // different line number
               result = true;
            }
         }
         else
         {
            if (otherLine == null ||
                thisLine.equals(otherLine) == false)
            {
               // different line number
               result = true;
            }
         }
      }

      return result;
   }
}
