指定した範囲の名前を登録する。
<p>POI-3.7以上が必要。
<p>指定した名前が既に存在する場合は、新しい範囲に書き換える。
@param sheet シート
@param name 名前
@param startPosition 設定するセルの開始位置
@param endPosition 設定するセルの終了位置
@return
163530
public static Name defineName(final Sheet sheet, final String name,
            final Point startPosition, final Point endPosition) {

        ArgUtils.notNull(sheet, "sheet");
        ArgUtils.notEmpty(name, "name");
        ArgUtils.notNull(startPosition, "startPosition");
        ArgUtils.notNull(endPosition, "endPosition");

        final Workbook workbook = sheet.getWorkbook();
        Name nameObj = workbook.getName(name);
        if(nameObj == null) {
            nameObj = workbook.createName();
            nameObj.setNameName(name);
        }

        final AreaReference areaRef = buildNameArea(sheet.getSheetName(), startPosition, endPosition,
                sheet.getWorkbook().getSpreadsheetVersion());
        nameObj.setRefersToFormula(areaRef.formatAsString());

        return nameObj;

    }
1215164
public void writeStartList(String name) throws IOException
   {
      writeComma();
      writeNewLineIndent();
      writeName(name);
      writeNewLineIndent();
      m_writer.write("[");
      increaseIndent();
   }
982299
def header(self, sheet, name):
        

        header = sheet.row(0)
        for i, column in enumerate(self.headers[name]):
            header.write(i, self.headers[name][i])
708618
public long registerEventName(String name) throws IOException {
        Preconditions.checkState(endStaticInfoOffset >= 0, "Cannot write name - have not written end of static info marker");

        FlatBufferBuilder fbb = new FlatBufferBuilder(0);
        long time = System.currentTimeMillis();
        int offset = UIEvent.createUIEvent(fbb, UIEventType.ADD_NAME, -1, time, 0, 0, (short)-1, 0, 0);
        fbb.finish(offset);

        FlatBufferBuilder fbb2 = new FlatBufferBuilder(0);
        int idx = nameIndexCounter.getAndIncrement();
        nameIndexMap.put(idx, name);
        indexNameMap.put(name, idx);
        int strOffset = fbb2.createString(name);
        int offset2 = UIAddName.createUIAddName(fbb2, idx, strOffset);
        fbb2.finish(offset2);

        long l = append(fbb, fbb2);
        return l;
    }
807618
public static function byName(Spreadsheet $spreadsheet, string $name): Sheet
    {
        if (!$spreadsheet->sheetNameExists($name)) {
            throw SheetNotFoundException::byName($name);
        }

        return new static($spreadsheet->getSheetByName($name));
    }
1169294
public WorkbookWriter setSheetName(@NonNull String name) {
    workbook.setSheetName(workbook.getSheetIndex(sheet.getSheetName()), name);
    return this;
  }
468719
public Reader<T> sheet(String sheetName) {
        if (StringUtil.isEmpty(sheetName)) {
            throw new IllegalArgumentException("sheet cannot be empty");
        }
        this.sheetName = sheetName;
        return this;
    }
800453
public Optional<SheetBindingErrors<P>> getBySheetName(final String sheetName) {
        return list.stream()
                .filter(b -> Utils.equals(b.getSheetName(), sheetName))
                .findFirst();
    }
339387
public String getNameByPosition(Integer position) {
        String name = null;

        name = this.order.get(position);

        return name;
    }
323223
public static Sheet getOrCreateSheet(Workbook book, String sheetName) {
		if (null == book) {
			return null;
		}
		sheetName = StrUtil.isBlank(sheetName) ? "sheet1" : sheetName;
		Sheet sheet = book.getSheet(sheetName);
		if (null == sheet) {
			sheet = book.createSheet(sheetName);
		}
		return sheet;
	}
789773
public static CellPosition of(final String address) {
        ArgUtils.notEmpty(address, "address");

        if(!matchedCellAddress(address)) {
            throw new IllegalArgumentException(address + " is wrong cell address pattern.");
        }

        return of(new CellReference(address));
    }
1322986
def sheet_by_name(name)
      index = @worksheets.index { |sheet| sheet.name == name }
      @worksheets[index] if index
    end
541764
private void initializeShowBottomSheetPreference() {
        Preference showBottomSheetPreference =
                findPreference(getString(R.string.show_bottom_sheet_preference_key));
        showBottomSheetPreference.setOnPreferenceClickListener(new OnPreferenceClickListener() {

            @Override
            public boolean onPreferenceClick(final Preference preference) {
                initializeBottomSheet();
                bottomSheet.show();
                return true;
            }

        });
    }
1020117
protected void __startSection(String name) {
        if (null == name) throw new NullPointerException("section name cannot be null");
        if (null != tmpOut) throw new IllegalStateException("section cannot be nested");
        tmpCaller = __caller;
        __caller = null;
        tmpOut = __buffer;
        __buffer = new StringBuilder();
        section = name;
    }
1104937
private void decodeSelection(final FacesContext context, final Sheet sheet, final String jsonSelection) {
        if (LangUtils.isValueBlank(jsonSelection)) {
            return;
        }

        try {
            // data comes in: [ [row, col, oldValue, newValue] ... ]
            final JSONArray array = new JSONArray(jsonSelection);
            sheet.setSelectedRow(array.getInt(0));
            sheet.setSelectedColumn(sheet.getMappedColumn(array.getInt(1)));
            sheet.setSelectedLastRow(array.getInt(2));
            sheet.setSelectedLastColumn(array.getInt(3));
            sheet.setSelection(jsonSelection);
        }
        catch (final JSONException e) {
            throw new FacesException("Failed parsing Ajax JSON message for cell selection event:" + e.getMessage(), e);
        }
    }
988844
public final Composite end(CellName cellName) {
        return start(cellName).withEOC(Composite.EOC.END);
    }
1350234
public boolean startsWith(Name name) {
		if (name.size() == 0) {
			return false;
		}

		DistinguishedName start = null;
		if (name instanceof DistinguishedName) {
			start = (DistinguishedName) name;
		}
		else {
			return false;
		}

		if (start.size() > this.size()) {
			return false;
		}

		Iterator longiter = names.iterator();
		Iterator shortiter = start.getNames().iterator();

		while (shortiter.hasNext()) {
			Object longname = longiter.next();
			Object shortname = shortiter.next();

			if (!longname.equals(shortname)) {
				return false;
			}
		}

		// All names in shortiter matched.
		return true;
	}