org.apache.poi.hssf.usermodel.HSSFWorkbook.getNameIndex()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.apache.poi.hssf.usermodel.HSSFWorkbook.getNameIndex()方法的一些代码示例,展示了HSSFWorkbook.getNameIndex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HSSFWorkbook.getNameIndex()方法的具体详情如下:
包路径:org.apache.poi.hssf.usermodel.HSSFWorkbook
类名称:HSSFWorkbook
方法名:getNameIndex

HSSFWorkbook.getNameIndex介绍

[英]As #getNameIndex(String) is not necessarily unique (name + sheet index is unique), this method is more accurate.
[中]由于#getNameIndex(String)不一定是唯一的(name+sheet index是唯一的),因此此方法更精确。

代码示例

代码示例来源:origin: org.apache.poi/poi

@Override
public HSSFName getName(String name) {
  int nameIndex = getNameIndex(name);
  if (nameIndex < 0) {
    return null;
  }
  return names.get(nameIndex);
}

代码示例来源:origin: org.apache.poi/poi

@Override
public void removeName(String name) {
  int index = getNameIndex(name);
  removeName(index);
}

代码示例来源:origin: org.apache.poi/poi

/**
 * As {@link #removeName(String)} is not necessarily unique
 * (name + sheet index is unique), this method is more accurate.
 *
 * @param name the name to remove.
 */
@Override
public void removeName(Name name) {
 int index = getNameIndex((HSSFName) name);
 removeName(index);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

@Override
public HSSFName getName(String name) {
  int nameIndex = getNameIndex(name);
  if (nameIndex < 0) {
    return null;
  }
  return names.get(nameIndex);
}

代码示例来源:origin: com.haulmont.thirdparty/poi

public HSSFName getName(String name) {
  int nameIndex = getNameIndex(name);
  if (nameIndex < 0) {
    return null;
  }
  return (HSSFName) names.get(nameIndex);
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

public HSSFName getName(String name) {
  int nameIndex = getNameIndex(name);
  if (nameIndex < 0) {
    return null;
  }
  return (HSSFName) names.get(nameIndex);
}

代码示例来源:origin: com.haulmont.thirdparty/poi

/**
 * As {@link #removeName(String)} is not necessarily unique 
 * (name + sheet index is unique), this method is more accurate.
 * 
 * @param name the name to remove.
 */
void removeName(HSSFName name) {
 int index = getNameIndex(name);
 removeName(index);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

@Override
public void removeName(String name) {
  int index = getNameIndex(name);
  removeName(index);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * As {@link #removeName(String)} is not necessarily unique
 * (name + sheet index is unique), this method is more accurate.
 *
 * @param name the name to remove.
 */
@Override
public void removeName(Name name) {
 int index = getNameIndex((HSSFName) name);
 removeName(index);
}

代码示例来源:origin: com.haulmont.thirdparty/poi

public void removeName(String name) {
  int index = getNameIndex(name);
  removeName(index);
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

public void removeName(String name) {
  int index = getNameIndex(name);
  removeName(index);
}

代码示例来源:origin: com.haulmont.yarg/yarg

public static AreaReference getAreaForRange(HSSFWorkbook workbook, String rangeName) {
  int rangeNameIdx = workbook.getNameIndex(rangeName);
  if (rangeNameIdx == -1) return null;
  HSSFName aNamedRange = workbook.getNameAt(rangeNameIdx);
  return new AreaReference(aNamedRange.getRefersToFormula(), SpreadsheetVersion.EXCEL97);
}

代码示例来源:origin: cuba-platform/yarg

public static HSSFSheet getTemplateSheetForRangeName(HSSFWorkbook workbook, String rangeName) {
    int rangeNameIdx = workbook.getNameIndex(rangeName);
    if (rangeNameIdx == -1) return null;

    HSSFName aNamedRange = workbook.getNameAt(rangeNameIdx);
    String sheetName = aNamedRange.getSheetName();
    return workbook.getSheet(sheetName);
  }
}

代码示例来源:origin: com.haulmont.yarg/yarg

public static HSSFSheet getTemplateSheetForRangeName(HSSFWorkbook workbook, String rangeName) {
    int rangeNameIdx = workbook.getNameIndex(rangeName);
    if (rangeNameIdx == -1) return null;

    HSSFName aNamedRange = workbook.getNameAt(rangeNameIdx);
    String sheetName = aNamedRange.getSheetName();
    return workbook.getSheet(sheetName);
  }
}

代码示例来源:origin: cuba-platform/yarg

public static AreaReference getAreaForRange(HSSFWorkbook workbook, String rangeName) {
  int rangeNameIdx = workbook.getNameIndex(rangeName);
  if (rangeNameIdx == -1) return null;
  HSSFName aNamedRange = workbook.getNameAt(rangeNameIdx);
  return new AreaReference(aNamedRange.getRefersToFormula(), SpreadsheetVersion.EXCEL97);
}

代码示例来源:origin: cuba-platform/yarg

int rangeNameIdx = templateWorkbook.getNameIndex(rangeName);
if (rangeNameIdx == -1) return;

代码示例来源:origin: com.haulmont.yarg/yarg

int rangeNameIdx = templateWorkbook.getNameIndex(rangeName);
if (rangeNameIdx == -1) return;

相关文章

HSSFWorkbook类方法