1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 /*
25  * SimplePdbCompare.java
26  *
27  * Created on September 21, 2001, 10:23 AM
28  */
29 
30 /**
31  *
32  * @author  mh101528
33  * @version
34  */
35 public final class SimplePdbCompare {
36 
37     /** Creates new SimplePdbCompare */
SimplePdbCompare()38     public SimplePdbCompare() {
39     }
40 
41     /**
42     * @param args the command line arguments
43     */
main(String args[])44     public static void main (String args[])
45     {
46         SimplePdbCompare comparator = new SimplePdbCompare();
47         if (comparator.comparePDB(args[0], args[1]))
48             System.exit(2);
49         else
50             System.exit(3);
51     }
52 
comparePDB(String pdbname1, String pdbname2)53     public boolean  comparePDB(String pdbname1, String pdbname2)
54     {
55         PalmDB pdb1=null, pdb2=null;
56         PDBDecoder decoder = new PDBDecoder();
57         try
58         {
59             pdb1 = decoder.parse(pdbname1);
60         }
61         catch (Exception e)
62         {
63             System.out.println("Could not parse PDB " + pdbname1);
64             return false;
65         }
66 
67         try
68         {
69             pdb2 = decoder.parse(pdbname2);
70         }
71         catch (Exception e)
72         {
73             System.out.println("Could not parse PDB " + pdbname2);
74             return false;
75         }
76 
77         if (pdb1.equals(pdb2))
78         {
79             //writeToLog("PDB " + pdbname1 + "  and PDB " + pdbname2 + " are equal");
80             System.out.println("PDB " + pdbname1 + "  and PDB " + pdbname2 + " are equal");
81             return true;
82         }
83         else
84         {
85             //writeToLog("PDB " + pdbname1 + "  and PDB " + pdbname2 + " are not equal");
86             System.out.println("PDB " + pdbname1 + "  and PDB " + pdbname2 + " are not equal");
87             return false;
88         }
89     }
90 }
91