资源简介
最简单方便的基于java的泰森多边形算法 可实现对多边形的渲染
代码片段和文件信息
package delaunay;
/*
* Copyright (c) 2007 by L. Paul Chew.
*
* Permission is hereby granted without written agreement and without
* license or royalty fees to use copy modify and distribute this
* software and its documentation for any purpose subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS
* OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING
* FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
import java.util.AbstractSet;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
/**
* An ArrayList implementation of Set. An ArraySet is good for small sets; it
* has less overhead than a HashSet or a TreeSet.
*
* @author Paul Chew
*
* Created December 2007. For use with Voronoi/Delaunay applet.
*
*/
public class ArraySet extends AbstractSet {
private ArrayList items; // Items of the set
/**
* Create an empty set (default initial capacity is 3).
*/
public ArraySet () {
this(3);
}
/**
* Create an empty set with the specified initial capacity.
* @param initialCapacity the initial capacity
*/
public ArraySet (int initialCapacity) {
items = new ArrayList(initialCapacity);
}
/**
* Create a set containing the items of the collection. Any duplicate
* items are discarded.
* @param collection the source for the items of the small set
*/
public ArraySet (Collection extends E> collection) {
items = new ArrayList(collection.size());
for (E item: collection)
if (!items.contains(item)) items.add(item);
}
/**
* Get the item at the specified index.
* @param index where the item is located in the ListSet
* @return the item at the specified index
* @throws IndexOutOfBoundsException if the index is out of bounds
*/
public E get (int index) throws IndexOutOfBoundsException {
return items.get(index);
}
/**
* True iff any member of the collection is also in the ArraySet.
* @param collection the Collection to check
* @return true iff any member of collection appears in this ArraySet
*/
public boolean containsAny (Collection> collection) {
for (object item: collection)
if (this.contains(item)) return true;
return false;
}
@Override
public boolean add(E item) {
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3269 2007-12-14 14:52 delaunay\ArraySet.java
文件 14597 2007-12-14 14:51 delaunay\DelaunayAp.java
文件 3825 2007-12-14 14:44 delaunay\Graph.java
文件 17519 2007-12-14 14:42 delaunay\Pnt.java
文件 5235 2007-12-14 14:44 delaunay\Triangle.java
文件 11137 2007-12-14 14:44 delaunay\Triangulation.java
目录 0 2007-12-14 14:53 delaunay\
- 上一篇:afinal.jar最新0.5.1
- 下一篇:基于递归分割的迷宫生成算法与自动寻路
相关资源
- SL275lab题目
- java加入购物车源码附数据库文件
- java 发邮件带excel附件,以流的形式发
- 基于JAVA开发的KTV前台管理系统
- Java实现逻辑回归算法(LogRegression)对
- JAVA数据结构复杂表达式求值
- JAVA+MySQL学生成绩管理系统
- java2word程序代码及jar包
- JAVAWeb外文文献翻译
- java音频开发.mp3文件解码jmp123.jar
- 某智Java图书管理系统,视频,代码
- java 使用jacob Word转PDF 完美格式
- 银行系统server数据库
- 带人工智能的五子棋java源程序
- java混淆jocky,不限jdk版本
-
gba
se-connector-java-8.3.81.53-build52.8-bi - java编写整合操作系统五个算法
- iso8583协议的java实现
- Java Socket编写的教学管理系统(简易版
- JAVA写的编译器编译原理课设
- \“java实现简单的单点登录\“源码包
- 学生选课管理系统JAVA+SQL
- Eclipse Java注释模板
- java高校就业管理系统源码
- Mongodb + GridFS +Java 操作Mongodb中存储的
- 基于MyEclipse开发的超市管理系统
- java web静态网页制作代码
- java编写的宠物医院管理系统
- Java语言程序设计课后习题解答+张思民
- java sound 简单播放器代码
评论
共有 条评论