本文整理匯總了Java中org.apache.poi.ss.util.CellReference.getCol方法的典型用法代碼示例。如果您正苦於以下問題:Java CellReference.getCol方法的具體用法?Java CellReference.getCol怎麽用?Java CellReference.getCol使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.poi.ss.util.CellReference
的用法示例。
在下文中一共展示了CellReference.getCol方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: fromA1Address
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
public static A1Address fromA1Address(String a1address) {
//check in pool
A1Address address = A1AddressPool.get(a1address);
if (address != null) { return address; }
//check if range
if (isRange(a1address)) { return new A1RangeAddress(a1address); }
//create
A1Address a = new A1Address();
a.address = a1address;
CellReference cr = new CellReference(a.address);
a.row = cr.getRow();
a.column = cr.getCol();
return a;
}
示例2: isReferenceValid
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
public boolean isReferenceValid(CellReference ref) {
if(ref == null)
return false;
String sheet = ref.getSheetName();
if(sheet == null || sheet.length()==0 || !sheets.contains(sheet))
return false;
if(ref.getCol() >= getMaxCol())
return false;
if(ref.getRow() >= getMaxRow())
return false;
return true;
}
示例3: getXY
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
public final static int[] getXY(String xy) {
xy = xy.trim();
if (StringUtils.isEmpty(xy)) {
return new int[] { -1, -1 };
}
if (!StringUtils.isAlphanumeric(xy)) {
return null;
}
CellReference ref = new CellReference(xy);
return new int[] { ref.getRow() < 0 ? -1 : ref.getRow(), ref.getCol() < 0 ? -1 : ref.getCol() };
}
示例4: getXY
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
protected int[] getXY(String xy) {
xy = xy.trim();
if (StringUtils.isEmpty(xy)) {
return new int[] { -1, -1 };
}
if (!StringUtils.isAlphanumeric(xy)) {
return null;
}
CellReference ref = new CellReference(xy);
return new int[] { ref.getRow() < 0 ? -1 : ref.getRow(), ref.getCol() < 0 ? -1 : ref.getCol() };
}
示例5: parseCellAddress
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
/**
* Excelのアドレス形式'A1'を、Pointに変換する。
* @param address
* @return 変換できない場合は、nullを返す。
*/
public static Point parseCellAddress(final String address) {
if(isEmpty(address)) {
return null;
}
final Matcher matcher = PATTERN_CELL_ADREESS.matcher(address);
if(!matcher.matches()) {
return null;
}
final CellReference ref = new CellReference(address.toUpperCase());
return new Point(ref.getCol(), ref.getRow());
}
示例6: toPointAddress
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
/**
* 文字列の形式のセルのアドレスを、Point形式に変換する。
* @param address
* @return
*/
public static Point toPointAddress(final String address) {
ArgUtils.notEmpty(address, "address");
CellReference ref = new CellReference(address);
return new Point(ref.getCol(), ref.getRow());
}
示例7: cell
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
@Override
public void cell(String cellReference, String formattedValue,XSSFComment comment) {
if(currentOutputRow!=-1){
CellReference ref = new CellReference(cellReference);
int col = ref.getCol();
if(col < table.getColumnCount()){
table.setValueAt(formattedValue, currentOutputRow, col);
}
}
}
示例8: isOverlapped
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
public boolean isOverlapped(Name name) {
String ref = name.getRefersToFormula();
int idx = ref.indexOf('!');
if (idx != -1) {
ref = ref.substring(idx + 1);
}
AreaReference area = new AreaReference(ref);
CellReference topLeft = area.getFirstCell();
CellReference bottomRight = area.getLastCell();
CellRangeAddress cra = new CellRangeAddress(
topLeft.getRow(), bottomRight.getRow(),
topLeft.getCol(), bottomRight.getCol()
);
return isOverlapped(cra);
}
示例9: setColumnName
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
private String setColumnName(String cellReference, String columnName)
{
CellReference reference = new CellReference(cellReference);
Integer column = new Integer(reference.getCol());
return this.map.put(column, columnName);
}
示例10: getColumnName
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
private String getColumnName(String cellReference)
{
CellReference reference = new CellReference(cellReference);
Integer column = new Integer(reference.getCol());
return this.map.get(column);
}
示例11: getField
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
public Field getField(String cellReference)
{
CellReference reference = new CellReference(cellReference);
Integer column = new Integer(reference.getCol());
if (!this.map.containsKey(column))
{
this.map.put(column, new Field());
}
return this.map.get(column);
}
示例12: getValidCellReference
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
public static CellReference getValidCellReference(Workbook wb, String ref) {
CellReference cr = getCellReference(wb, ref);
String shName = cr.getSheetName();
if(shName == null || wb.getSheetIndex(shName) < 0 ||
cr.getRow() < 0 || cr.getCol() < 0)
return null;
return cr;
}
示例13: XlsxTableReader
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
public XlsxTableReader(CellReference ref, TableFactory<T> factory) {
this.factory = factory;
sheetName = ref.getSheetName();
firstRow = ref.getRow();
prevRow = firstRow;
firstColumn = ref.getCol();
prevColumn = firstColumn;
lastColumn = firstColumn;
}
示例14: XlsTableReader
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
public XlsTableReader(CellReference ref, TableFactory<T> factory) {
this.factory = factory;
sheetName = ref.getSheetName();
firstRow = ref.getRow();
firstColumn = ref.getCol();
lastColumn = firstColumn;
prevRow = firstRow;
}
示例15: getColumnIndex
import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
public static int getColumnIndex(String name) {
CellReference ref = new CellReference(name);
return ref.getCol();
}