meetpred.java

来自「本程序是由JAVA实现的R-树新建、结点增加、删除功能。」· Java 代码 · 共 43 行

JAVA
43
字号
//MeetPred.java//  //This library is free software; you can redistribute it and/or//modify it under the terms of the GNU Lesser General Public//License as published by the Free Software Foundation; either//version 2.1 of the License, or (at your option) any later version.//  //This library is distributed in the hope that it will be useful,//but WITHOUT ANY WARRANTY; without even the implied warranty of//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU//Lesser General Public License for more details.package rtree.join;import rtree.*;import java.util.List;/**   The "intersects" binary predicate. This is only for the sweepline algo.   @author Prachuryya Barua*/public class MeetPred extends Predicate{  public MeetPred(){}  public void relate(Element event, int from, Element[] others, List pairs, int evtSide)  {    (new IntersectPred()).relate(event, from, others, pairs, evtSide);  }    public boolean relateMismatch(Element nlElmt, Element lfElmt, int side)  {    try{      //if(nlElmt instanceof NonLeafElement)      return nlElmt.getRect().overlaps(lfElmt.getRect());      //else      //return nlElmt.getRect().meet(lfElmt.getRect());    }catch(Exception e){      e.printStackTrace();      return false;    }  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?