104b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller/* 204b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller * Copyright (C) 2015 The Android Open Source Project 304b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller * 404b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller * Licensed under the Apache License, Version 2.0 (the "License"); 504b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller * you may not use this file except in compliance with the License. 604b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller * You may obtain a copy of the License at 704b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller * 804b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller * http://www.apache.org/licenses/LICENSE-2.0 904b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller * 1004b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller * Unless required by applicable law or agreed to in writing, software 1104b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller * distributed under the License is distributed on an "AS IS" BASIS, 1204b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1304b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller * See the License for the specific language governing permissions and 1404b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller * limitations under the License. 1504b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller */ 16ac1c676b1256aaa85c5cc22494ea56bd2d276b9fNeil Fullerpackage com.google.currysrc.api.process.ast; 1704b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller 1804b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fullerimport org.eclipse.jdt.core.dom.ASTNode; 1904b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller 2004b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller/** 2104b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller * A comparator of ASTNode start positions. 2204b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller */ 2304b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fullerpublic final class StartPositionComparator implements java.util.Comparator<ASTNode> { 2404b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller @Override 2504b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller public int compare(ASTNode o1, ASTNode o2) { 2604b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller return Integer.compare(o1.getStartPosition(), o2.getStartPosition()); 2704b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller } 2804b228542fa91e91551c6ea4e6a2bac1d55ca1afNeil Fuller} 29