📄 column.java
字号:
/*
* Created on 2004-3-22
*
* To change the template for this generated file go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
package com.zosatapo.xls.core;
/**
* @author Administrator
*
* To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
public class Column
{
public final static Column NULL_COLUMN=new Column(-1,null);
private int columnIndex; //based on 0
private Type type;
private Type inType;
private Type outType;
private String name;
//需要时候用于列长度检查
private int length;
//某些列将不从EXCEL/JDBC 中获取的数值
private Object defaultValue;
public Column(int index_,String name_)
{
this(index_,null,name_,Integer.MAX_VALUE,null);
}
public Column(int index_,Type type_,String name_)
{
this(index_,type_,name_,Integer.MAX_VALUE,null);
}
public Column(int index_,Type type_,String name_,Cell defaultValue)
{
this(index_,type_,name_,Integer.MAX_VALUE,defaultValue);
}
public Column(int index_,Type type_,String name_,int length_,Cell defaultValue)
{
this(index_,type_,null,null,name_,length_,null);
}
public Column(int index_,Type type_,Type in_,Type out_,String name_)
{
this(index_,type_,in_,out_,name_,Integer.MAX_VALUE);
}
public Column(int index_,Type type_,Type in_,Type out_,String name_,int length_)
{
this(index_,type_,in_,out_,name_,length_,null);
}
public Column(int index_,Type type_,Type in_,Type out_,String name_,int length_,Cell defaultValue)
{
this.columnIndex=index_;
this.type=type_;
this.inType=in_;
this.outType=out_;
this.name=name_;
this.length=length_;
this.defaultValue=defaultValue;
}
public String getName()
{
return name;
}
public Type getType()
{
return type;
}
public boolean isNull()
{
return name==null;
}
public void setType(Type colType)
{
type=colType;
}
public Type getInType()
{
return inType;
}
public void setInType(Type inType_)
{
inType=inType_;
}
public Type getOutType()
{
return outType;
}
public void setOutType(Type outType_)
{
outType=outType_;
}
public int getIndex()
{
return this.columnIndex;
}
public void setIndex(int index_)
{
this.columnIndex=index_;
}
public int getLength()
{
return length;
}
public void setLength(int length_)
{
length=length_;
}
public Object getDefaultValue()
{
return defaultValue;
}
public void setDefaultValue(Object defValue)
{
this.defaultValue=defValue;
}
public boolean useDefault()
{
return defaultValue!=null;
}
public String toString()
{
if(isNull())
{
return "[Column] <null>";
}
String string="[Column] index="+columnIndex
+",name="+name
+",type={"+type+"}"
+",inType={"+inType+"}"
+",outType={"+outType+"}"
+",length="+length
+",default="+defaultValue;
return string;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -