testobject.java

来自「Eclipse代码生成器,支持Eclipse3.3 WTP版本,该项目实现了Sp」· Java 代码 · 共 65 行

JAVA
65
字号
package com.newegg.test;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class TestObject
{
	private String name;
	private int price;

	public TestObject ( String name , int price )
	{
//		System.out.println(TYPE_NAMES.getClass().getName());
//		for (int i = 0; i < TYPE_NAMES.size(); i++)
//		{
//			String array_element = (String)TYPE_NAMES.get(i);
//			System.out.println(array_element);
//			
//		}
		this.name = name;
		this.price = price;		
	}

	// JavaBean properties
	// Note that public fields are not visible directly;
	// you must write a getter method for them.
	public String getName()
	{
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name)
	{
		this.name = name;
	}

	/**
	 * @param price
	 *            the price to set
	 */
	public void setPrice(int price)
	{
		this.price = price;
	}

	public int getPrice()
	{
		return price;
	}

	// A method
	public double sin(double x)
	{
		return Math.sin(x);
	}

	public static final List TYPE_NAMES = Collections.unmodifiableList(Arrays.asList(new String[]
	{ "UNKNOWN", "TIME", "DATE", "DATETIME" }));
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?