code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231
values | license stringclasses 13
values | size int64 1 2.01M |
|---|---|---|---|---|---|
/*
* Copyright 2012 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.thinking_in_java.thread._21_2_1;
/**
*
* @author 周光明 Exp
* @version $FileName: MainThread.java $Date: 2012-4-11 下午9:49:22 -0400 2012
* @si... | zyr-test | trunk/zyr-test/src/com/zgm/thinking_in_java/thread/_21_2_1/MainThread.java | Java | asf20 | 480 |
package com.zgm.effective_java._3._9._1;
import java.util.Arrays;
public class BeanTestHashCode {
private short shortField;
private int intField;
private long longField;
private float floatField;
private double doubleField;
private String stringField;
private int[] intArrayField;
public BeanT... | zyr-test | trunk/zyr-test/src/com/zgm/effective_java/_3/_9/_1/BeanTestHashCode.java | Java | asf20 | 3,954 |
package com.zgm.effective_java._3._8._1;
public class BeanTestEquals {
private String stringField;
private int intField;
private float floatField;
private double doubleField;
public BeanTestEquals(int intField, float floatField, double doubleField, String stringField) {
this.intField = intField;
... | zyr-test | trunk/zyr-test/src/com/zgm/effective_java/_3/_8/_1/BeanTestEquals.java | Java | asf20 | 1,772 |
package com.zgm.webservices.client.server;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for sayHelloResponse complex type.
*
* <p>The follow... | zyr-test | trunk/zyr-test/src/com/zgm/webservices/client/server/SayHelloResponse.java | Java | asf20 | 1,505 |
@javax.xml.bind.annotation.XmlSchema(namespace = "http://server.webservices.zgm.com/")
package com.zgm.webservices.client.server;
| zyr-test | trunk/zyr-test/src/com/zgm/webservices/client/server/package-info.java | Java | asf20 | 132 |
package com.zgm.webservices.client.server;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
/**
* This object contains factory methods for each
* Java content interface and Java element i... | zyr-test | trunk/zyr-test/src/com/zgm/webservices/client/server/ObjectFactory.java | Java | asf20 | 2,460 |
package com.zgm.webservices.client.server;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for sayHello complex type.
*
* <p>The following schema fragment specifies the expected content con... | zyr-test | trunk/zyr-test/src/com/zgm/webservices/client/server/SayHello.java | Java | asf20 | 1,371 |
/*
* Copyright 2012 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.webservices.client;
import com.zgm.webservices.client.server.WebServicesTest;
import com.zgm.webservices.client.server.WebServicesTestService;
... | zyr-test | trunk/zyr-test/src/com/zgm/webservices/client/ClientTest.java | Java | asf20 | 768 |
/*
* Copyright 2012 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.webservices.server;
import javax.jws.WebMethod;
import javax.jws.WebService;
/**
*
* @author 周光明 Exp
* @version $FileName: WebServices... | zyr-test | trunk/zyr-test/src/com/zgm/webservices/server/WebServicesTest.java | Java | asf20 | 565 |
/*
* Copyright 2012 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.webservices.server;
import java.util.LinkedList;
import java.util.List;
import javax.xml.ws.Binding;
import javax.xml.ws.Endpoint;
import j... | zyr-test | trunk/zyr-test/src/com/zgm/webservices/server/DeployeWebServices.java | Java | asf20 | 921 |
package com.zgm.iterator;
public class Node {
private Object data;
private Node next;
public Node(){};
public Node(Object data, Node next) {
super();
this.data = data;
this.next = next;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data... | zyr-test | trunk/zyr-test/src/com/zgm/iterator/Node.java | Java | asf20 | 439 |
package com.zgm.iterator;
public class MyArrayList {
Object[] objects = new Object[10];
private int index = 0;
public void add(Object obj){
if(index == objects.length){
Object[] newObjects = new Object[objects.length * 2];
System.arraycopy(objects, 0, newObjects, 0, objects.length);
obje... | zyr-test | trunk/zyr-test/src/com/zgm/iterator/MyArrayList.java | Java | asf20 | 563 |
package com.zgm.iterator;
public class MyLinkedList {
private Node head = null;
private Node tail = null;
private int index = 0;
public void add(Object obj){
Node node = new Node();
node.setData(obj);
node.setNext(null);
if(head == null){
head = node;
tail = node;
index++;
... | zyr-test | trunk/zyr-test/src/com/zgm/iterator/MyLinkedList.java | Java | asf20 | 624 |
package com.zgm.iterator;
public class Main {
public static void main(String[] strs){
MyArrayList list = new MyArrayList();
for(int i = 0; i < 20; i++){
list.add("你好: " + i);
}
for(int i = 0; i < list.size(); i++){
System.out.println(list.get(i));
}
System.out.println(list.size());
... | zyr-test | trunk/zyr-test/src/com/zgm/iterator/Main.java | Java | asf20 | 501 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.ninth_classLoader._3;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/ninth_classLoader/_3/GreetingClassLoader.java | Java | asf20 | 1,801 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.ninth_classLoader._3;
/**
*
* @author 周光明 Exp
* @version $FileName: ParentLastClassLoader.java $Date: 2013-3-18 下午9:46... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/ninth_classLoader/_3/ParentLastClassLoader.java | Java | asf20 | 912 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.ninth_classLoader._3;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/ninth_classLoader/_3/FileSystemClassLoader.java | Java | asf20 | 1,846 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.ninth_classLoader._2;
/**
*
* @author 周光明 Exp
* @version $FileName: DisplayTheLevelOfClassloader.java $Date: 2013-3-... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/ninth_classLoader/_2/DisplayTheLevelOfClassloader.java | Java | asf20 | 824 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.ninth_classLoader._1;
/**
*
* @author 周光明 Exp
* @version $FileName: LoadClassTest.java $Date: 2013-3-13 下午9:56:21 -040... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/ninth_classLoader/_1/LoadClassTest.java | Java | asf20 | 871 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.ninth_classLoader._4.isolation._2;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
i... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/ninth_classLoader/_4/isolation/_2/ClassIdentity.java | Java | asf20 | 1,547 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.ninth_classLoader._4.isolation._2;
import java.nio.file.Path;
/**
*
* @author 周光明 Exp
* @version $FileName: Paren... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/ninth_classLoader/_4/isolation/_2/ParentLastClassLoader.java | Java | asf20 | 1,093 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.ninth_classLoader._4.isolation._2;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import j... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/ninth_classLoader/_4/isolation/_2/FileSystemClassLoader.java | Java | asf20 | 2,027 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.ninth_classLoader._4.isolation._2;
/**
*
* @author 周光明 Exp
* @version $FileName: Sample.java $Date: 2013-3-18 下午10:0... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/ninth_classLoader/_4/isolation/_2/Sample.java | Java | asf20 | 592 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.ninth_classLoader._4.isolation._1;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
i... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/ninth_classLoader/_4/isolation/_1/ClassIdentity.java | Java | asf20 | 1,607 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.ninth_classLoader._4.isolation._1;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import j... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/ninth_classLoader/_4/isolation/_1/FileSystemClassLoader.java | Java | asf20 | 1,859 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.ninth_classLoader._4.isolation._1;
/**
*
* @author 周光明 Exp
* @version $FileName: Sample.java $Date: 2013-3-18 下午10:0... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/ninth_classLoader/_4/isolation/_1/SampleNot.java | Java | asf20 | 604 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._3;
/**
*
* @author 周光明 Exp
* @version $FileName: OrderGateway.java $Date: 20... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_3/OrderGateway.java | Java | asf20 | 549 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._3;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.O... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_3/SerializationUtils.java | Java | asf20 | 1,143 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._3;
import java.io.ObjectStreamException;
import java.io.Serializable;
/**
*... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_3/Order.java | Java | asf20 | 774 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._3;
import java.io.ObjectStreamException;
import java.io.Serializable;
/**
*
... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_3/OrderTO.java | Java | asf20 | 709 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._3;
/**
*
* @author 周光明 Exp
* @version $FileName: Address.java $Date: 2013-3-... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_3/Address.java | Java | asf20 | 723 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._3;
import java.io.Serializable;
/**
*
* @author 周光明 Exp
* @version $FileN... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_3/User.java | Java | asf20 | 997 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._3;
import java.io.IOException;
/**
*
* @author 周光明 Exp
* @version $FileNa... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_3/OrderTest.java | Java | asf20 | 788 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._2._2;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_2/_2/WriteUser.java | Java | asf20 | 1,089 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._2._2;
import java.io.IOException;
import java.io.InvalidObjectException;
import j... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_2/_2/NewUser.java | Java | asf20 | 2,247 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._2._2;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.n... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_2/_2/ReadUser.java | Java | asf20 | 1,113 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._2._1;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_2/_1/WriteUser.java | Java | asf20 | 967 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._2._1;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.i... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_2/_1/NewUser.java | Java | asf20 | 1,026 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._2._1;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.n... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_2/_1/ReadUser.java | Java | asf20 | 1,113 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._1;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.nio... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_1/WriteUser.java | Java | asf20 | 1,043 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._1;
import java.io.ObjectStreamField;
import java.io.Serializable;
/**
*
* ... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_1/User.java | Java | asf20 | 907 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._1;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.nio.... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_1/ReadUser.java | Java | asf20 | 1,100 |
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.zgm.understandingTheJava7.tenth_objectLifecycle.serialization._6._6;
import java.io.Externalizable;
import java.io.IOException;
import java.io.Obje... | zyr-test | trunk/zyr-test/src/com/zgm/understandingTheJava7/tenth_objectLifecycle/serialization/_6/_6/ExternalizableUser.java | Java | asf20 | 1,849 |
package com.zgm.eclipse;
public class ErrorTest {
public static int test = 0;
public static void main(String[] args){
// System.out.println( 10 / 0);
System.out.println(factorial(6));
}
public static int factorial(int value){
test++;
if(0 == value){
return value;
}else{
re... | zyr-test | trunk/zyr-test/src/com/zgm/eclipse/ErrorTest.java | Java | asf20 | 368 |
package com.zgm.zen.bridge.example2;
public abstract class Corp {
protected abstract void produce();
protected abstract void sell();
public void makeMoney(){
this.produce();
this.sell();
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example2/Corp.java | Java | asf20 | 218 |
package com.zgm.zen.bridge.example2;
import com.zgm.zen.bridge.example1.Corp;
public class IPodCorp extends Corp {
@Override
protected void produce() {
System.out.println("我生产IPod");
}
@Override
protected void sell() {
System.out.println("IPod畅销中。。");
}
@Override
public void makeMone... | zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example2/IPodCorp.java | Java | asf20 | 429 |
package com.zgm.zen.bridge.example2;
public class Client {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println("-------房地产公司是这样运行的------");
HouseCorp houseCorp = new HouseCorp();
houseCorp.makeMoney();
System.out.println("\n");
/*System.out.prin... | zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example2/Client.java | Java | asf20 | 627 |
package com.zgm.zen.bridge.example2;
public class HouseCorp extends Corp {
@Override
protected void produce() {
System.out.println("房地产公司盖房子。。。");
}
@Override
protected void sell() {
System.out.println("房地产公司出售房子。。。");
}
@Override
public void makeMoney(){
super.makeMoney();
Sys... | zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example2/HouseCorp.java | Java | asf20 | 433 |
package com.zgm.zen.bridge.example2;
public class ClothesCorp extends Corp {
@Override
protected void produce() {
System.out.println("服装公司生产衣服。。。");
}
@Override
protected void sell() {
System.out.println("服装公司出售衣服。。。");
}
@Override
public void makeMoney(){
super.makeMoney();
Syst... | zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example2/ClothesCorp.java | Java | asf20 | 424 |
package com.zgm.zen.bridge.example1;
public abstract class Corp {
protected abstract void produce();
protected abstract void sell();
public void makeMoney(){
this.produce();
this.sell();
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example1/Corp.java | Java | asf20 | 218 |
package com.zgm.zen.bridge.example1;
public class Client {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println("-------房地产公司是这样运行的------");
HouseCorp houseCorp = new HouseCorp();
houseCorp.makeMoney();
System.out.println("\n");
System.out.printl... | zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example1/Client.java | Java | asf20 | 489 |
package com.zgm.zen.bridge.example1;
public class HouseCorp extends Corp {
@Override
protected void produce() {
System.out.println("房地产公司盖房子。。。");
}
@Override
protected void sell() {
System.out.println("房地产公司出售房子。。。");
}
@Override
public void makeMoney(){
super.makeMoney();
Sys... | zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example1/HouseCorp.java | Java | asf20 | 433 |
package com.zgm.zen.bridge.example1;
public class ClothesCorp extends Corp {
@Override
protected void produce() {
System.out.println("服装公司生产衣服。。。");
}
@Override
protected void sell() {
System.out.println("服装公司出售衣服。。。");
}
@Override
public void makeMoney(){
super.makeMoney();
Syst... | zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example1/ClothesCorp.java | Java | asf20 | 424 |
package com.zgm.zen.bridge.example3;
public abstract class Product {
public abstract void beProducted();
public abstract void beSell();
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example3/Product.java | Java | asf20 | 152 |
package com.zgm.zen.bridge.example3;
public class IPod extends Product {
@Override
public void beProducted() {
System.out.println("生产IPod..");
}
@Override
public void beSell() {
System.out.println("IPod热卖中..");
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example3/IPod.java | Java | asf20 | 258 |
package com.zgm.zen.bridge.example3;
public abstract class Corp {
private Product product;
public Corp(Product product) {
super();
this.product = product;
}
public void makeMoney(){
this.product.beProducted();
this.product.beSell();
}
}
/*public abstract class Corp {
p... | zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example3/Corp.java | Java | asf20 | 463 |
package com.zgm.zen.bridge.example3;
public class Client {
public static void main(String[] args) {
House house = new House();
System.out.println("-------房地产公司是这样运行的------");
HouseCorp houseCorp = new HouseCorp(house);
houseCorp.makeMoney();
System.out.println("\n");
/*System.ou... | zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example3/Client.java | Java | asf20 | 1,255 |
package com.zgm.zen.bridge.example3;
public class HouseCorp extends Corp {
public HouseCorp(House house){
super(house);
}
@Override
public void makeMoney(){
super.makeMoney();
System.out.println("房地产公司赚大钱了。。。");
}
}
/*public class HouseCorp extends Corp {
@Override
protected void ... | zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example3/HouseCorp.java | Java | asf20 | 670 |
package com.zgm.zen.bridge.example3;
public class ShanZhaiCorp extends Corp {
public ShanZhaiCorp(Product product) {
super(product);
}
public void makeMoney(){
super.makeMoney();
System.out.println("我赚钱了。。。。");
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example3/ShanZhaiCorp.java | Java | asf20 | 257 |
package com.zgm.zen.bridge.example3;
public class House extends Product {
@Override
public void beProducted() {
System.out.println("生产出的IPod是这样的。。");
}
@Override
public void beSell() {
System.out.println("生产出的IPod卖出去了。。");
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/example3/House.java | Java | asf20 | 296 |
package com.zgm.zen.bridge.common;
public class ConcreteImplementor1 implements Implementor {
@Override
public void doAnything() {
System.out.println("业务逻辑处理somthing 1");
}
@Override
public void doSomething() {
System.out.println("业务逻辑处理Anything 1");
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/common/ConcreteImplementor1.java | Java | asf20 | 310 |
package com.zgm.zen.bridge.common;
/**
* 实现化角色
* @author Administrator
*
*/
public interface Implementor {
//基本方法
public void doSomething();
public void doAnything();
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/common/Implementor.java | Java | asf20 | 212 |
package com.zgm.zen.bridge.common;
public class ConcreteImplementor2 implements Implementor {
@Override
public void doAnything() {
System.out.println("业务逻辑处理somthing 2");
}
@Override
public void doSomething() {
System.out.println("业务逻辑处理Anything 2");
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/common/ConcreteImplementor2.java | Java | asf20 | 310 |
package com.zgm.zen.bridge.common;
/**
* 具体抽象化角色
* @author Administrator
*
*/
public class RefinedAbstracting extends Abstration {
public RefinedAbstracting(Implementor imp) {
super(imp);
}
//修正父类的行为
public void request(){
System.out.println("业务处理");
super.request();
super.... | zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/common/RefinedAbstracting.java | Java | asf20 | 387 |
package com.zgm.zen.bridge.common;
public class Client {
/**
* @param args
*/
public static void main(String[] args) {
Implementor imp = new ConcreteImplementor1();
Abstration abs = new RefinedAbstracting(imp);
abs.request();
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/common/Client.java | Java | asf20 | 270 |
package com.zgm.zen.bridge.common;
/**
* 抽象化角色
* @author Administrator
*
*/
public class Abstration {
//定义对实现化角色的引用
private Implementor imp;
//约束子类必须实现该构造函数
public Abstration(Implementor imp){
this.imp = imp;
}
public void request(){
this.imp.doSomething();
}
public Implemen... | zyr-test | trunk/zyr-test/src/com/zgm/zen/bridge/common/Abstration.java | Java | asf20 | 420 |
package com.zgm.zen.integration.establishPattern_thirty.factoryVSbuilder.factory;
public class Clinet {
/**
* @param args
*/
public static void main(String[] args) {
ISuperMan adultSuperMan = SuperManFactory.createSuperMan("adult");
adultSuperMan.specialTalent();
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/factoryVSbuilder/factory/Clinet.java | Java | asf20 | 301 |
package com.zgm.zen.integration.establishPattern_thirty.factoryVSbuilder.factory;
public class ChildSuperMan implements ISuperMan {
@Override
public void specialTalent() {
System.out.println("小超人刀枪不入!");
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/factoryVSbuilder/factory/ChildSuperMan.java | Java | asf20 | 244 |
package com.zgm.zen.integration.establishPattern_thirty.factoryVSbuilder.factory;
public class AdultSuperMan implements ISuperMan {
@Override
public void specialTalent() {
System.out.println("超人力在无穷!");
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/factoryVSbuilder/factory/AdultSuperMan.java | Java | asf20 | 241 |
package com.zgm.zen.integration.establishPattern_thirty.factoryVSbuilder.factory;
public class SuperManFactory {
public static ISuperMan createSuperMan(String type){
if(type.equalsIgnoreCase("adult")){
return new AdultSuperMan();
}else if(type.equalsIgnoreCase("child")){
return new ChildSuperMan();... | zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/factoryVSbuilder/factory/SuperManFactory.java | Java | asf20 | 361 |
package com.zgm.zen.integration.establishPattern_thirty.factoryVSbuilder.factory;
public interface ISuperMan {
public void specialTalent();
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/factoryVSbuilder/factory/ISuperMan.java | Java | asf20 | 151 |
package com.zgm.zen.integration.establishPattern_thirty.factoryVSbuilder.builder;
public class ChildSuperManBuilder extends Builder {
@Override
public SuperMan getSuperMan() {
super.setBody("强壮的身体");
super.setSpecialTalent("刀枪不入");
super.setSpecialSymbol("胸前带有小S标志");
return super.superMan;
... | zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/factoryVSbuilder/builder/ChildSuperManBuilder.java | Java | asf20 | 362 |
package com.zgm.zen.integration.establishPattern_thirty.factoryVSbuilder.builder;
public abstract class Builder {
protected final SuperMan superMan = new SuperMan();
public void setBody(String body){
this.superMan.setBody(body);
}
public void setSpecialSymbol(String specialSymbol) {
this.superM... | zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/factoryVSbuilder/builder/Builder.java | Java | asf20 | 525 |
package com.zgm.zen.integration.establishPattern_thirty.factoryVSbuilder.builder;
public class SuperMan {
private String body;
private String specialSymbol;
private String specialTalent;
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public Str... | zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/factoryVSbuilder/builder/SuperMan.java | Java | asf20 | 643 |
package com.zgm.zen.integration.establishPattern_thirty.factoryVSbuilder.builder;
public class Director {
private static Builder adultBuilder = new AdultSuperManBuilder();
private static Builder childBuilder = new ChildSuperManBuilder();
public static SuperMan getAdultSuperMan(){
return adultBuilder.ge... | zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/factoryVSbuilder/builder/Director.java | Java | asf20 | 431 |
package com.zgm.zen.integration.establishPattern_thirty.factoryVSbuilder.builder;
public class AdultSuperManBuilder extends Builder {
@Override
public SuperMan getSuperMan() {
super.setBody("强壮的身体");
super.setSpecialTalent("会飞行");
super.setSpecialSymbol("胸前有S标志");
return super.superMan;
}... | zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/factoryVSbuilder/builder/AdultSuperManBuilder.java | Java | asf20 | 353 |
package com.zgm.zen.integration.establishPattern_thirty.factoryVSbuilder.builder;
public class Client {
public static void main(String[] args){
SuperMan adultSuperMan = Director.getAdultSuperMan();
adultSuperMan.getSpecialTalent();
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/factoryVSbuilder/builder/Client.java | Java | asf20 | 257 |
package com.zgm.zen.integration.establishPattern_thirty.abstractFactoryVSbuilder.abstractFactory;
public interface CarFactory {
public ICar createSuv();
public ICar createVan();
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/abstractFactoryVSbuilder/abstractFactory/CarFactory.java | Java | asf20 | 194 |
package com.zgm.zen.integration.establishPattern_thirty.abstractFactoryVSbuilder.abstractFactory;
public class BenzSuv extends AbsBenz {
private final static String G_SERIES = "G系列SUV";
@Override
public String getModel() {
return BenzSuv.G_SERIES;
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/abstractFactoryVSbuilder/abstractFactory/BenzSuv.java | Java | asf20 | 279 |
package com.zgm.zen.integration.establishPattern_thirty.abstractFactoryVSbuilder.abstractFactory;
public class BMWVan extends AbsBMW {
private final static String SEVENT_SEARIES = "7系列型商务车";
@Override
public String getModel() {
return BMWVan.SEVENT_SEARIES;
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/abstractFactoryVSbuilder/abstractFactory/BMWVan.java | Java | asf20 | 301 |
package com.zgm.zen.integration.establishPattern_thirty.abstractFactoryVSbuilder.abstractFactory;
public class BenzVan extends AbsBenz {
private final static String R_SERIES = "R系列商务车";
@Override
public String getModel() {
return BenzVan.R_SERIES;
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/abstractFactoryVSbuilder/abstractFactory/BenzVan.java | Java | asf20 | 285 |
package com.zgm.zen.integration.establishPattern_thirty.abstractFactoryVSbuilder.abstractFactory;
public abstract class AbsBMW implements ICar {
private final static String BMW_BAND = "宝马汽车";
@Override
public String getBrand() {
return BMW_BAND;
}
public abstract String getModel();
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/abstractFactoryVSbuilder/abstractFactory/AbsBMW.java | Java | asf20 | 328 |
package com.zgm.zen.integration.establishPattern_thirty.abstractFactoryVSbuilder.abstractFactory;
public interface ICar {
public String getBrand();
public String getModel();
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/abstractFactoryVSbuilder/abstractFactory/ICar.java | Java | asf20 | 190 |
package com.zgm.zen.integration.establishPattern_thirty.abstractFactoryVSbuilder.abstractFactory;
public class BenzFactory implements CarFactory {
@Override
public ICar createSuv() {
return new BenzSuv();
}
@Override
public ICar createVan() {
return new BenzVan();
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/abstractFactoryVSbuilder/abstractFactory/BenzFactory.java | Java | asf20 | 298 |
package com.zgm.zen.integration.establishPattern_thirty.abstractFactoryVSbuilder.abstractFactory;
public class Client {
public static void main(String[] args){
System.out.println("=========要求生产一辆SUV==========");
CarFactory carFactory = new BenzFactory();
ICar benzSuv = carFactory.createSu... | zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/abstractFactoryVSbuilder/abstractFactory/Client.java | Java | asf20 | 481 |
package com.zgm.zen.integration.establishPattern_thirty.abstractFactoryVSbuilder.abstractFactory;
public abstract class AbsBenz implements ICar {
private final static String BENZ_BAND = "奔驰汽车";
@Override
public String getBrand() {
return AbsBenz.BENZ_BAND;
}
public abstract String getModel();
... | zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/abstractFactoryVSbuilder/abstractFactory/AbsBenz.java | Java | asf20 | 331 |
package com.zgm.zen.integration.establishPattern_thirty.abstractFactoryVSbuilder.abstractFactory;
public class BMWFactory implements CarFactory {
@Override
public ICar createSuv() {
return new BMWSuv();
}
@Override
public ICar createVan() {
return new BMWVan();
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/abstractFactoryVSbuilder/abstractFactory/BMWFactory.java | Java | asf20 | 295 |
package com.zgm.zen.integration.establishPattern_thirty.abstractFactoryVSbuilder.abstractFactory;
public class BMWSuv extends AbsBMW {
private final static String X_SEARIES = "奔驰汽车";
@Override
public String getModel() {
return BMWSuv.X_SEARIES;
}
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/integration/establishPattern_thirty/abstractFactoryVSbuilder/abstractFactory/BMWSuv.java | Java | asf20 | 284 |
package com.zgm.zen.iterator.example2;
public interface IProject {
public String getProjectInfo();
public void add(String name, int num, int cost);
public IProjectIterator iterator();
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/iterator/example2/IProject.java | Java | asf20 | 205 |
package com.zgm.zen.iterator.example2;
import java.util.ArrayList;
import com.zgm.zen.iterator.example2.IProject;
public class ProjectIterator implements IProjectIterator {
private ArrayList<IProject> projectList = new ArrayList<IProject>();
private int currentItem = 0;
public ProjectIterator(ArrayL... | zyr-test | trunk/zyr-test/src/com/zgm/zen/iterator/example2/ProjectIterator.java | Java | asf20 | 737 |
package com.zgm.zen.iterator.example2;
import java.util.Iterator;
public interface IProjectIterator extends Iterator {
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/iterator/example2/IProjectIterator.java | Java | asf20 | 131 |
package com.zgm.zen.iterator.example2;
import java.util.ArrayList;
import com.zgm.zen.iterator.example2.Project;
public class Project implements IProject {
ArrayList<IProject> projectList = new ArrayList<IProject>();
private String name = "";
private int num = 0;
private int cost = 0;
publi... | zyr-test | trunk/zyr-test/src/com/zgm/zen/iterator/example2/Project.java | Java | asf20 | 909 |
package com.zgm.zen.iterator.example2;
import java.util.ArrayList;
public class Boss {
/*public static void main(String[] args) {
ArrayList<IProuect> projectList = new ArrayList<IProuect>();
projectList.add(new Project("星球大战项目", 10, 10000));
projectList.add(new Project("项目2", 120, 100030))... | zyr-test | trunk/zyr-test/src/com/zgm/zen/iterator/example2/Boss.java | Java | asf20 | 1,344 |
package com.zgm.zen.iterator.example;
public interface IProject {
public String getProjectInfo();
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/iterator/example/IProject.java | Java | asf20 | 109 |
package com.zgm.zen.iterator.example;
import java.util.ArrayList;
import com.zgm.zen.iterator.example.IProject;
public class Project implements IProject {
private String name = "";
private int num = 0;
private int cost = 0;
public Project(){
}
public Project(String name, int num, i... | zyr-test | trunk/zyr-test/src/com/zgm/zen/iterator/example/Project.java | Java | asf20 | 1,121 |
package com.zgm.zen.iterator.example;
import java.util.ArrayList;
public class Boss {
/**
* @param args
*/
public static void main(String[] args) {
ArrayList<IProject> projectList = new ArrayList<IProject>();
projectList.add(new Project("星球大战项目", 10, 10000));
projectList.add(new Proje... | zyr-test | trunk/zyr-test/src/com/zgm/zen/iterator/example/Boss.java | Java | asf20 | 757 |
package com.zgm.zen.iterator.common;
import java.util.Vector;
public class ConcreteAggregate implements Aggregate {
private Vector vector = new Vector();
@Override
public void add(Object object) {
this.vector.add(object);
}
@Override
public Iterator iterator() {
return new Concrete... | zyr-test | trunk/zyr-test/src/com/zgm/zen/iterator/common/ConcreteAggregate.java | Java | asf20 | 440 |
package com.zgm.zen.iterator.common;
public class Client {
public static void main(String[] args){
Aggregate agg = new ConcreteAggregate();
agg.add("abc");
agg.add("aaa");
agg.add("ddss");
Iterator iterator = agg.iterator();
while(iterator.hasNext()){
System.out.println(iter... | zyr-test | trunk/zyr-test/src/com/zgm/zen/iterator/common/Client.java | Java | asf20 | 347 |
package com.zgm.zen.iterator.common;
import java.util.Vector;
public class ConcreteIterator implements Iterator {
private Vector vector = new Vector();
public int cursor = 0;
@SuppressWarnings("unchecked")
public ConcreteIterator(Vector vector){
this.vector = vector;
}
@Override
public bo... | zyr-test | trunk/zyr-test/src/com/zgm/zen/iterator/common/ConcreteIterator.java | Java | asf20 | 734 |
package com.zgm.zen.iterator.common;
public interface Aggregate {
public void add(Object objet);
public void remove(Object objet);
public Iterator iterator();
}
| zyr-test | trunk/zyr-test/src/com/zgm/zen/iterator/common/Aggregate.java | Java | asf20 | 180 |