// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) deadcode 
// Source File Name:   DocumentStructureNumberComparator.java

package com.ptc.windchill.pdmlink.doc.server.processors;

import java.text.Collator;
import java.util.Comparator;
import java.util.Locale;
import wt.doc.WTDocument;
import wt.doc.WTDocumentMaster;

public class DocumentStructureNumberComparator
    implements Comparator
{

    public int compare(Object arg0, Object arg1)
    {
        String string1 = getString(arg0);
        String string2 = getString(arg1);
        return Collator.getInstance(locale).compare(string1, string2);
    }

    public DocumentStructureNumberComparator(Locale locale)
    {
        this.locale = null;
        this.locale = locale;
    }

    private String getString(Object obj)
    {
        String str = "";
        if(obj instanceof Object[])
        {
            Object items1[] = (Object[])obj;
            if(items1[1] instanceof WTDocument)
            {
                WTDocument doc1 = (WTDocument)items1[1];
                str = doc1.getNumber();
            } else
            if(items1[1] instanceof WTDocumentMaster)
            {
                WTDocumentMaster doc1 = (WTDocumentMaster)items1[1];
                str = doc1.getNumber();
            }
        }
        return str;
    }

    static Class _mthclass$(String x0)
    {
        return Class.forName(x0);
        ClassNotFoundException x1;
        x1;
        throw (new NoClassDefFoundError()).initCause(x1);
    }

    private static final String RESOURCE = "com.ptc.windchill.pdmlink.doc.server.processors.processorsResource";
    private static final String CLASSNAME;
    private Locale locale;

    static 
    {
        CLASSNAME = (com.ptc.windchill.pdmlink.doc.server.processors.DocumentStructureNumberComparator.class).getName();
    }
}
