Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/sablecc/sablecc/NodeComparator.java


1   /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2    * This file is part of SableCC.                             *
3    * See the file "LICENSE" for copyright information and the  *
4    * terms and conditions for copying, distribution and        *
5    * modification of SableCC.                                  *
6    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
7   
8   package org.sablecc.sablecc;
9   
10  import java.util.*;
11  import com.sun.java.util.collections.*;
12  import org.sablecc.sablecc.node.*;
13  
14  public class NodeComparator implements Comparator
15  {
16      public final static NodeComparator instance = new NodeComparator();
17  
18      private NodeComparator()
19      {
20      }
21  
22      public int compare(Object o1, Object o2)
23      {
24          return ((Node) o1).getId() - ((Node) o2).getId();
25      }
26  }
27