易截截图软件、单文件、免安装、纯绿色、仅160KB

几种常见的数据结构的JAVA实现

 ITree
package utility.structure.def;
/**
*
* @author odie.tang
*
* @version 1.0 10/30/09
*/
public interface ITree<E>{

E getData();

E remove();

void setData(E e);

int getDepth();

int getLevel();

ITree<E> getRoot();

ITree<E> getParent();

ITree<E> getFirstChild();

ITree<E> addFirtChild(E e);

ITree<E> getLastChild();

ITree<E> addLastChild(E e);

ITree<E> getNode(E e);

boolean isLeaf();

boolean isRoot();

boolean remove(E e);
}

IBinaryTree
package utility.structure.def;
public interface IBinaryTree<E> extends ITree<E>{

boolean hasLeftChild();

boolean isLeftChild();

IBinaryTree<E> getLeftChild();

IBinaryTree<E> addLeftChild(E e);

boolean hasRightChild();

boolean isRightChild();

IBinaryTree<E> getRightChild();

IBinaryTree<E> addRightChild(E e);
}
BinaryTree
package utility.structure;
import java.io.Serializable;
import java.util.ConcurrentModificationException;
import utility.structure.def.IBinaryTree;
import utility.structure.def.ITree;
/**
*
* @author odie.tang
*
* @since 1.0 11/01/09
*/
public class BinaryTree<E> implements IBinaryTree<E>,Serializable{

private static final long serialVersionUID = 1565285530988892541L;
private E data;
private BinaryTree<E> parent = null;
private BinaryTree<E> leftChild = null;
private BinaryTree<E> rightChild = null;
private int level;
private enum Child{left,right}

public BinaryTree(E root) {
this.data = root;
this.level = 1;
}

public BinaryTree(E root, E leftChild){
this.data = root;
this.level = 1;
new BinaryTree<E>(this,Child.left,leftChild);
}

public BinaryTree(E root, E leftChild,E rightChild){
this.data = root;
this.level = 1;
new BinaryTree<E>(this,Child.left,leftChild);
new BinaryTre


相关文档:

java中加密算法的应用一:DES

第一种DES加密算法
import java.security.Key;
 
import java.security.SecureRandom;
 
import javax.crypto.Cipher;
 
import javax.crypto.KeyGenerator;
 
 
/**

*

* 使用DES加密与解密,可对byte[],String类型进行加密与解密 密文可使用 ......

Java数字格式化输出

       我们经常要将数字进行格式化,比如取2位小数,这是最常见的。Java 提供 DecimalFormat 类,帮你用最快的速度将数字格式化为你需要的样子。下面是一个例子:
importjava.text.DecimalFormat;
publicclassTestNumberFormat{
publicstaticvoidmain(String[]args){ ......

Java常用代码

     /**
     * 创建一个新的文件
     * @param relativePath 相对路径
     * @param fileName 文件名
     * @return
     * @throws IOException
     */
    public File cre ......

java applet嵌入html页的正常显示问题

比如applet文件是AppletTest.class
1)
在AppletTest.java的代码中
使用默认包,即不用package语句
在html页中的代码是
<applet code="AppletTest.class" width="400" height="300">
</applet>
AppletTest.class文件和html页放在一个文件夹中
2)
在AppletTest.java的代码中
package xx.yy;
在html页 ......

Create WAP Push SMS Messages (from C# to JAVA)

 猪年无聊,改了一个代码,有点D版那个意思,把WAP PUSH的C#代码改到了JAVA
原来出处:
http://www.codeproject.com/cs/internet/wappush.asp
改过后的代码在下面,程序好像可以输出了WAPPUSH的结构化的东西,但是,没有在CMPP协议上测试通过。
共7个文件:
package com.wap.wbxml;
public class Runner {
&nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号