📄 tchooseclosed.java
字号:
/**
* Thalmann算法中,根据节点的坐标从链表中找出该节点
**/
package page;
import java.util.*;
public class TChooseClosed
{
public TNodes result=new TNodes();
//无参构造函数
public TChooseClosed()
{
}
//有参构造函数
public TChooseClosed(LinkedList closed, int x,int y)
{
if(closed.size()>0)
{
int position=0;
result=(TNodes)closed.get(position);
int nowx=result.getX();
int nowy=result.getY();
while(nowx!=x||nowy!=y)
{
position++;
if(position<closed.size())
{
result=(TNodes)closed.get(position);
nowx=result.getX();
nowy=result.getY();
}
else
{
result=null;
break;
}
}
}
else result=null;
}
public TNodes getNode()
{
return result;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -