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


Java Numbers.getInteger方法代碼示例

本文整理匯總了Java中com.trollworks.toolkit.utility.text.Numbers.getInteger方法的典型用法代碼示例。如果您正苦於以下問題:Java Numbers.getInteger方法的具體用法?Java Numbers.getInteger怎麽用?Java Numbers.getInteger使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.trollworks.toolkit.utility.text.Numbers的用法示例。


在下文中一共展示了Numbers.getInteger方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: extractFromResolutionString

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private static PrinterResolution extractFromResolutionString(String buffer) {
	if (buffer != null && buffer.length() > 0) {
		int sep = buffer.indexOf('x');
		int x;
		int y;

		if (sep != -1 && sep < buffer.length() - 1) {
			x = Numbers.getInteger(buffer.substring(0, sep), 0);
			y = Numbers.getInteger(buffer.substring(sep + 1), 0);
		} else {
			x = Numbers.getInteger(buffer, 0);
			y = x;
		}
		if (x < 1 || y < 1) {
			return null;
		}
		return new PrinterResolution(x, y, 1);
	}
	return null;
}
 
開發者ID:Ayutac,項目名稱:toolkit,代碼行數:21,代碼來源:PrintManager.java

示例2: applySortConfigInternal

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private int applySortConfigInternal(String config) {
	int result = -1;
	if (config != null && config.startsWith("S")) { //$NON-NLS-1$
		try {
			StringTokenizer tokenizer = new StringTokenizer(config, "\t"); //$NON-NLS-1$
			if (Numbers.getInteger(tokenizer.nextToken().substring(1), 0) == CONFIG_VERSION) {
				int count = Numbers.getInteger(tokenizer.nextToken(), 0);
				if (clearSortInternal()) {
					result = 0;
				}
				for (int i = 0; i < count; i++) {
					Column column = getColumnWithID(Numbers.getInteger(tokenizer.nextToken(), 0));
					if (column == null) {
						throw new Exception();
					}
					column.setSortCriteria(Numbers.getInteger(tokenizer.nextToken(), -1), Numbers.getBoolean(tokenizer.nextToken()));
					if (column.getSortSequence() != -1) {
						result = 1;
					}
				}
			}
		} catch (Exception exception) {
			// It's a bad config... ignore it.
		}
	}
	return result;
}
 
開發者ID:Ayutac,項目名稱:toolkit,代碼行數:28,代碼來源:OutlineModel.java

示例3: readInteger

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
/**
 * @param defValue The default value to return if the text cannot be converted to an integer.
 * @return The integer value of a call to {@link #readText()}.
 */
public int readInteger(int defValue) throws IOException {
	return Numbers.getInteger(readText(), defValue);
}
 
開發者ID:Ayutac,項目名稱:toolkit,代碼行數:8,代碼來源:XMLReader.java

示例4: getAttributeAsInteger

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
/**
 * @param name The attribute name.
 * @param defValue The default value to use if the attribute value can't be converted to an
 *            integer.
 * @return The value of the tag.
 */
public int getAttributeAsInteger(String name, int defValue) {
	return Numbers.getInteger(mAttributeMap.get(name), defValue);
}
 
開發者ID:Ayutac,項目名稱:toolkit,代碼行數:10,代碼來源:XMLReader.java


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