⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edge.java

📁 机器人设计的Java源程序,提供给大家参考参考
💻 JAVA
字号:
// Copyright (C) 2002 Takeshi Morimoto <morimoto@takopen.cs.uec.ac.jp>// All rights reserved.package yab.agent.object;import java.util.*;import yab.agent.DisasterSpace;import yab.io.object.*;public abstract class Edge extends MotionlessObject {    public Edge(int id, BaseEdge object, DisasterSpace world)    { super(id, object, world); }    private BaseEdge obj() { return (BaseEdge) object; }    private PointObject m_head = null;    private PointObject m_tail = null;    public PointObject head() {        if (m_head == null) m_head = (PointObject) world.get(obj().head());        return m_head;    }    public PointObject tail() {        if (m_tail == null)            m_tail = (PointObject) world.get(obj().tail());        return m_tail;    }    public int length() { return obj().length(); }    public int x() { return (head().x() + tail().x()) / 2; }    public int y() { return (head().y() + tail().y()) / 2; }    private ArrayList m_endpoints = null;    public Collection neighborhood() {        if (m_endpoints == null) {            m_endpoints = new ArrayList(2);            m_endpoints.add(head());            m_endpoints.add(tail());        }        return m_endpoints;    }}

⌨️ 快捷键说明

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