¼¸ÖÖ³£¼ûµÄÊý¾Ý½á¹¹µÄJAVAʵÏÖ
Ê÷ÊÇÒ»¸öµÝ¹éµÄÊý¾Ý½á¹¹£¬Ò»¿ÃÊ÷ÉϵÄËùÓнڵ㶼¿ÉÒÔ±»¿´³ÉÊÇÒ»¿ÃÊ÷£¬Ö»²»¹ý³ý¸ù½ÚµãÍâÆäËû½Úµã¶¼±È×ÜÊ÷µÄ¹æģСµã¶øÒÑ¡£Ê÷µÄ½ÚµãÓÐÈýÖÖ£º¸ù½Úµã£¨Ã»Óи¸Ç׽ڵ㣩£¬Ò¶×ӽڵ㣨ûÓк¢×ӽڵ㣩£¬Ò»°ã½Úµã£¨¼ÈÓи¸Ç׽ڵ㣬ҲÓк¢×ӽڵ㣩¡£¾ßÌå¶Ô½á¹¹µÄ·ÖÎö£¬¼¸ºõËùÓÐдÊý¾Ý½á¹¹µÄÊéÖж¼ÓÐÌáµ½¡£
Õâ¿ÃÊ÷µÄʵÏÖ»¨Á˺ü¸Ììʱ¼ä£¬Åöµ½µÄ×î´óÎÊÌâÊÇJAVAµÄ·ºÐÍ£¬ÔÚ¶Ô·ºÐͲ»ÊÇ×ã¹»Á˽âµÄÊÂʵÏ£¬Ëƺõµ½´¦¶¼Åöµ½ÏÝÚ壬ÐÒ¿÷ÔÚÕâÖмäµÃµ½ÁËÖÜÊ÷Ⱥͬ־µÄ¶¦Á¦ÏàÖú£¬ËùÒÔÔÚÕâÀï±íÑïËûÀÏÈ˼ÒÒ»°Ñ£ºÖÜÊ÷ȺÊǸöºÃͬ־£¡
²»¹ÜÔõô˵£¬Ò»¿Ã¼òµ¥µÄÊ÷ÒѾʵÏÖÁË£¬ÒÔºóÒªÓõ½Ê÷µÄµØ·½¾Í·½±ã¶àÁË£¨Ä¿Ç°ÎªÖ¹ÎÒ»¹Ã»¿´µ½JDKÀïÓÐרÃŵÄÊ÷µÄʵÏÖ£©¡£ÏÂÃæÊÇÕâ¿ÃÊ÷µÄ½Ó¿ÚITree£¬ÒÔ¼°¾ßÌåʵÏÖÀàOriginalTree¡£
ITree:
package utility.structure.def;
import java.util.Collection;
import java.util.List;
/**
*
* @author odie.tang
*
* @version 1.0 10/30/09
*/
public interface ITree<E>{
E getData();
void set(E e);
E remove();
int getDepth();
int getLevel();
ITree<E> getParent();
ITree<E> getFirstChild();
ITree<E> getLastChild();
ITree<E> addChild(int childIndex,E e);
void addChildren(Collection<? extends E> children);
void addChildren(int childIndex, Collection<? extends E> children);
ITree<E> addChild(E e);
ITree<E> getChild(int childIndex);
E removeChild(int childIndex);
List<ITree<E>> getChildren();
boolean isLeaf();
boolean isRoot();
ITree<E> getRoot();
boolean remove(E e);
ITree<E> getNode(E e);
}
OriginalTree:
package utility.structure;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.List;
import java.util.NoSuchElementException;
import utility.structure.def.ITree;
/**
* @author odie.tang
* @version 1.0 , 10/30/09
*/
public class OriginalTree<E> implements ITree<E>,Serializable {
private static final long serialVersionUID =
Ïà¹ØÎĵµ£º
String Óë StringBufferÇø±ð:
String×Ö·û´®¶ÔÏóÊDz»¿É±äµÄ£»StringBufferÊDZ䳤ºÍ¿ÉдµÄ¶¯Ì¬×Ö·ûÐòÁУ¬¿ÉÒÔ×Ô¶¯µØÔö¼Ó¿Õ¼ä¡£
Integer var = new Integer();//ÓÐÓï·¨´íÎó
Integer var = new Integer(2);//悦﵀
javaµÄVector³ÉÔ±ÊÇÒªÓÃelementAt(i)³ÉÔ±º¯ÊýÀ´»ñµÃµÄ£¬²»ÄÜÓÃve[i]µÃµ½¡£
Vector::public Enumeration& ......
Vector : »ùÓÚArrayµÄList£¬Æäʵ¾ÍÊÇ·â×°ÁËArrayËù²»¾ß±¸µÄһЩ¹¦ÄÜ·½±ãÎÒÃÇʹÓã¬Ëü²»¿ÉÄÜ×ßÈëArrayµÄÏÞÖÆ¡£ÐÔÄÜÒ²¾Í²»¿ÉÄÜ
³¬Ô½Array¡£ËùÒÔ£¬ÔÚ¿ÉÄܵÄÇé¿öÏ£¬ÎÒÃÇÒª¶àÔËÓÃArray¡£ÁíÍâºÜÖØÒªµÄÒ»µã¾ÍÊÇVector“sychronized”µÄ£¬Õâ¸öÒ²ÊÇVectorºÍ
ArrayListµÄΨһµÄÇø±ð¡£
ArrayList£ºÍ¬VectorÒ»ÑùÊÇÒ»¸ö»ùÓ ......
import java.util.LinkedList;
//µ¥Ïò¶ÓÁÐ
public class Queue {
public Queue() {
}
private LinkedList list = new LinkedList();
public void pu ......
//java.io
---------------------------------------------------------------
/**
* Title: ÎļþµÄ¸÷ÖÖ²Ù×÷
* Copyright: Copyright (c) 2004
* Company: ¹ã¶« ÓÐÏÞ¹«Ë¾
* @author ÍøÂçÐÅÏ¢²¿ Çì·á
* @version 1.0
*/
p ......
/*ÏÈ°ÑÏÂÔصÄÎļþ·ÅÔÚUpdateTempÎļþ¼ÐÖУ¬´ýÈ«²¿ÏÂÔغó£¬ÔÙ°Ñ´ËÎļþ¼ÐÖеÄÎļþÒƳöÌæ»»¾ÉÎļþ*/
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
......