當前位置: 首頁>>代碼示例>>Java>>正文


Java CellReference.getCol方法代碼示例

本文整理匯總了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;
}
 
開發者ID:DataArt,項目名稱:CalculationEngine,代碼行數:19,代碼來源:A1Address.java

示例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;
}
 
開發者ID:Depter,項目名稱:JRLib,代碼行數:17,代碼來源:ReferenceUtil.java

示例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() };
}
 
開發者ID:niuxuetao,項目名稱:paxml,代碼行數:12,代碼來源:ExcelRange.java

示例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() };
}
 
開發者ID:niuxuetao,項目名稱:paxml,代碼行數:12,代碼來源:ReadExcelTag.java

示例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());
}
 
開發者ID:mygreen,項目名稱:xlsmapper,代碼行數:20,代碼來源:Utils.java

示例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());
}
 
開發者ID:mygreen,項目名稱:xlsmapper,代碼行數:12,代碼來源:TestUtils.java

示例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);					
		}
	}
}
 
開發者ID:PGWelch,項目名稱:com.opendoorlogistics,代碼行數:11,代碼來源:XmlParserLoader.java

示例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);
}
 
開發者ID:shunjikonishi,項目名稱:excel2canvas,代碼行數:16,代碼來源:InputRule.java

示例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);
}
 
開發者ID:terraframe,項目名稱:geoprism,代碼行數:8,代碼來源:SourceContentHandler.java

示例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);
}
 
開發者ID:terraframe,項目名稱:geoprism,代碼行數:8,代碼來源:SourceContentHandler.java

示例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);
}
 
開發者ID:terraframe,項目名稱:geoprism,代碼行數:13,代碼來源:FieldInfoContentsHandler.java

示例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;
}
 
開發者ID:Depter,項目名稱:JRLib,代碼行數:9,代碼來源:ExcelUtil.java

示例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;
}
 
開發者ID:Depter,項目名稱:JRLib,代碼行數:10,代碼來源:XlsxTableReader.java

示例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;
}
 
開發者ID:Depter,項目名稱:JRLib,代碼行數:9,代碼來源:XlsTableReader.java

示例15: getColumnIndex

import org.apache.poi.ss.util.CellReference; //導入方法依賴的package包/類
public static int getColumnIndex(String name) {
	CellReference ref = new CellReference(name);
	return ref.getCol();
}
 
開發者ID:niuxuetao,項目名稱:paxml,代碼行數:5,代碼來源:ExcelColumn.java


注:本文中的org.apache.poi.ss.util.CellReference.getCol方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。