concreteprototype1.java
来自「Java设计模式(GOF)代码样例以及文档说明」· Java 代码 · 共 40 行
JAVA
40 行
/*
* 项目名称 Pattern
* 包名称 com.niufish.pattern.prototype
*
* 文件名称 ConcretePrototype1.java
*
*/
package com.niufish.pattern.prototype;
/**
* 具体的原始模型类1
* <p>
* <a href="ConcretePrototype1.java.html"><i>View Source</i></a>
* </p>
* @author Kingfish
* @version 1.0
*/
public class ConcretePrototype1 implements Cloneable {
private String _type;
public String getType() {
return _type;
}
public void setType(String type) {
this._type = type;
}
/**
* 克隆方法
* @see java.lang.Object#clone()
*/
public Object clone(){
ConcretePrototype1 temp = new ConcretePrototype1();
temp.setType(_type);
return (Object)temp;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?