itemattribute.java

来自「一个简单的商品采集系统」· Java 代码 · 共 50 行

JAVA
50
字号
import java.io.*;//to serialize the record so it can be write into the file with the method WriteObject()//notice that the parent class should implement the Interface 'Serializable'//Use integers to choose the contents of constrains  public class ItemAttribute implements Serializable{	//attribute name	private String name;	//attribute type	private int type;	//length of the field	private int length;	//the tag of the constrain	private boolean constrainTag;	//the constrain of the field	private int constrain;		public ItemAttribute() { this ( "",0,0,true,0 ); }		public ItemAttribute( String gn, int gt, int gl, boolean gct, int gc )	{		setName ( gn );		setType ( gt );		setLength ( gl );		setConstrainTag ( gct );		setConstrain ( gc );	}		public void setName( String gn ) { name = gn; }		public String getName () { return name; }		public void setType( int gt ) { type = gt; }		public int getType () { return type; }		public void setLength( int gl ) { length = gl; }		public int getLength () { return length; }		public void setConstrainTag( boolean gct ) { constrainTag = gct; }		public boolean getConstrainTag () { return constrainTag; }		public void setConstrain( int gc ) { constrain = gc; }		public int getConstrain () { return constrain; }	}

⌨️ 快捷键说明

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