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


Java Numbers.extractInteger方法代碼示例

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


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

示例1: writeBestWeaponDefense

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private void writeBestWeaponDefense(BufferedWriter out, Function<MeleeWeaponStats, String> resolver) throws IOException {
    String best = "-";
    int bestValue = Integer.MIN_VALUE;
    for (WeaponDisplayRow row : new FilteredIterator<>(mSheet.getMeleeWeaponOutline().getModel().getRows(), WeaponDisplayRow.class)) {
        MeleeWeaponStats weapon = (MeleeWeaponStats) row.getWeapon();
        String result = resolver.apply(weapon).trim();
        if (result.length() > 0 && !"No".equals(result)) {
            int value = Numbers.extractInteger(result, 0, false);
            if (value > bestValue) {
                bestValue = value;
                best = result;
            }
        }
    }
    writeEncodedText(out, best);
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:17,代碼來源:TextTemplate.java

示例2: getMinStrengthValue

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
/** @return The minimum ST to use this weapon, or -1 if there is none. */
public int getMinStrengthValue() {
    StringBuilder builder = new StringBuilder();
    int count = mStrength.length();
    boolean started = false;
    for (int i = 0; i < count; i++) {
        char ch = mStrength.charAt(i);
        if (Character.isDigit(ch)) {
            builder.append(ch);
            started = true;
        } else if (started) {
            break;
        }
    }
    return started ? Numbers.extractInteger(builder.toString(), -1, false) : -1;
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:17,代碼來源:WeaponStats.java

示例3: costTypeChanged

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private void costTypeChanged() {
    boolean hasLevels = hasLevels();

    if (hasLevels) {
        mLevelField.setText(Numbers.format(mLastLevel));
    } else {
        mLastLevel = Numbers.extractInteger(mLevelField.getText(), 0, true);
        mLevelField.setText(EMPTY);
    }
    mLevelField.setEnabled(hasLevels);
    updateCostField();
    updateCostModifier();
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:14,代碼來源:ModifierEditor.java

示例4: getCurrentTechLevel

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private static int getCurrentTechLevel(Equipment equipment) {
    String tl = equipment.getTechLevel();
    if (tl != null) {
        tl = tl.trim();
        if (!tl.isEmpty()) {
            for (int i = tl.length(); --i >= 0;) {
                if (!Character.isDigit(tl.charAt(i))) {
                    return -1;
                }
            }
            return Numbers.extractInteger(tl, -1, 0, Integer.MAX_VALUE, false);
        }
    }
    return -1;
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:16,代碼來源:EquipmentOutline.java

示例5: getCurrentTechLevel

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private static int getCurrentTechLevel(Skill skill) {
    String tl = skill.getTechLevel();
    if (tl != null) {
        tl = tl.trim();
        if (!tl.isEmpty()) {
            for (int i = tl.length(); --i >= 0;) {
                if (!Character.isDigit(tl.charAt(i))) {
                    return -1;
                }
            }
            return Numbers.extractInteger(tl, -1, 0, Integer.MAX_VALUE, false);
        }
    }
    return -1;
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:16,代碼來源:SkillOutline.java

示例6: processStyleIndentWarning

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private static boolean processStyleIndentWarning(String key, BufferedWriter out, ListRow row) throws IOException {
    if (key.equals(KEY_STYLE_INDENT_WARNING)) {
        StringBuilder style = new StringBuilder();
        int depth = row.getDepth();
        if (depth > 0) {
            style.append(" style=\"padding-left: ");
            style.append(depth * 12);
            style.append("px;");
        }
        if (!row.isSatisfied()) {
            if (style.length() == 0) {
                style.append(" style=\"");
            }
            style.append(" color: red;");
        }
        if (style.length() > 0) {
            style.append("\" ");
            out.write(style.toString());
        }
    } else if (key.startsWith(KEY_PREFIX_DEPTH)) {
        int amt = Numbers.extractInteger(key.substring(6), 1, false);
        out.write("" + amt * row.getDepth());
    } else if (key.equals(KEY_SATISFIED)) {
        out.write(row.isSatisfied() ? "Y" : "N");
    } else {
        return false;
    }
    return true;
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:30,代碼來源:TextTemplate.java

示例7: getCurrentTechLevel

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private static int getCurrentTechLevel(Spell spell) {
    String tl = spell.getTechLevel();
    if (tl != null) {
        tl = tl.trim();
        if (!tl.isEmpty()) {
            for (int i = tl.length(); --i >= 0;) {
                if (!Character.isDigit(tl.charAt(i))) {
                    return -1;
                }
            }
            return Numbers.extractInteger(tl, -1, 0, Integer.MAX_VALUE, false);
        }
    }
    return -1;
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:16,代碼來源:SpellOutline.java

示例8: getCost

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private int getCost() {
    return Numbers.extractInteger(mCostField.getText(), 0, true);
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:4,代碼來源:ModifierEditor.java

示例9: getLevels

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private int getLevels() {
    return Numbers.extractInteger(mLevelField.getText(), 0, true);
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:4,代碼來源:ModifierEditor.java

示例10: getQty

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private int getQty() {
    if (mQtyField != null) {
        return Numbers.extractInteger(mQtyField.getText(), 0, true);
    }
    return 1;
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:7,代碼來源:EquipmentEditor.java

示例11: getSkillPoints

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private int getSkillPoints() {
    return Numbers.extractInteger(mPointsField.getText(), 0, true);
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:4,代碼來源:SkillEditor.java

示例12: getPoints

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private int getPoints() {
    return Numbers.extractInteger(mPointsField.getText(), 0, true);
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:4,代碼來源:TechniqueEditor.java

示例13: getDefaultModifier

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private int getDefaultModifier() {
    return Numbers.extractInteger(mDefaultModifierField.getText(), 0, true);
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:4,代碼來源:TechniqueEditor.java

示例14: getLimitModifier

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private int getLimitModifier() {
    return Numbers.extractInteger(mLimitField.getText(), 0, true);
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:4,代碼來源:TechniqueEditor.java

示例15: getSpellPoints

import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private int getSpellPoints() {
    return Numbers.extractInteger(mPointsField.getText(), 0, true);
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:4,代碼來源:SpellEditor.java


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