当前位置: 首页>>代码示例>>Java>>正文


Java XMLReader.readInteger方法代码示例

本文整理汇总了Java中com.trollworks.toolkit.io.xml.XMLReader.readInteger方法的典型用法代码示例。如果您正苦于以下问题:Java XMLReader.readInteger方法的具体用法?Java XMLReader.readInteger怎么用?Java XMLReader.readInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.trollworks.toolkit.io.xml.XMLReader的用法示例。


在下文中一共展示了XMLReader.readInteger方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadSubElement

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
@Override
protected void loadSubElement(XMLReader reader, LoadState state) throws IOException {
    String name = reader.getName();
    if (TAG_NAME.equals(name)) {
        mName = reader.readText().replace("\n", " "); //$NON-NLS-1$ //$NON-NLS-2$
    } else if (TAG_REFERENCE.equals(name)) {
        mReference = reader.readText().replace("\n", " "); //$NON-NLS-1$ //$NON-NLS-2$
    } else if (TAG_COST.equals(name)) {
        mCostType = Enums.extract(reader.getAttribute(ATTRIBUTE_COST_TYPE), CostType.values(), CostType.PERCENTAGE);
        if (mCostType == CostType.MULTIPLIER) {
            mCostMultiplier = reader.readDouble(1.0);
        } else {
            mCost = reader.readInteger(0);
        }
    } else if (TAG_LEVELS.equals(name)) {
        mLevels = reader.readInteger(0);
    } else if (TAG_AFFECTS.equals(name)) {
        mAffects = Enums.extract(reader.readText(), Affects.values(), Affects.TOTAL);
    } else {
        super.loadSubElement(reader, state);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:23,代码来源:Modifier.java

示例2: loadSubElement

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
@Override
protected void loadSubElement(XMLReader reader, LoadState state) throws IOException {
    String name = reader.getName();
    if (TAG_DESCRIPTION.equals(name)) {
        mDescription = reader.readText().replace(NEWLINE, SPACE);
    } else if (TAG_TECH_LEVEL.equals(name)) {
        mTechLevel = reader.readText().replace(NEWLINE, SPACE);
    } else if (TAG_LEGALITY_CLASS.equals(name)) {
        mLegalityClass = reader.readText().replace(NEWLINE, SPACE);
    } else if (TAG_VALUE.equals(name)) {
        mValue = reader.readDouble(0.0);
    } else if (TAG_WEIGHT.equals(name)) {
        mWeight = WeightValue.extract(reader.readText(), false);
    } else if (TAG_REFERENCE.equals(name)) {
        mReference = reader.readText().replace(NEWLINE, SPACE);
    } else if (!state.mForUndo && (TAG_EQUIPMENT.equals(name) || TAG_EQUIPMENT_CONTAINER.equals(name))) {
        addChild(new Equipment(mDataFile, reader, state));
    } else if (MeleeWeaponStats.TAG_ROOT.equals(name)) {
        mWeapons.add(new MeleeWeaponStats(this, reader));
    } else if (RangedWeaponStats.TAG_ROOT.equals(name)) {
        mWeapons.add(new RangedWeaponStats(this, reader));
    } else if (OldWeapon.TAG_ROOT.equals(name)) {
        state.mOldWeapons.put(this, new OldWeapon(reader));
    } else if (!canHaveChildren()) {
        if (TAG_QUANTITY.equals(name)) {
            mQuantity = reader.readInteger(1);
        } else {
            super.loadSubElement(reader, state);
        }
    } else {
        super.loadSubElement(reader, state);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:34,代码来源:Equipment.java

示例3: loadSubElement

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
@Override
protected void loadSubElement(XMLReader reader, LoadState state) throws IOException {
    String name = reader.getName();
    if (TAG_NAME.equals(name)) {
        mName = reader.readText().replace(NEWLINE, SPACE);
    } else if (TAG_SPECIALIZATION.equals(name)) {
        mSpecialization = reader.readText().replace(NEWLINE, SPACE);
    } else if (TAG_TECH_LEVEL.equals(name)) {
        mTechLevel = reader.readText().replace(NEWLINE, SPACE);
        if (mTechLevel != null) {
            DataFile dataFile = getDataFile();
            if (dataFile instanceof ListFile || dataFile instanceof LibraryFile) {
                mTechLevel = EMPTY;
            }
        }
    } else if (TAG_REFERENCE.equals(name)) {
        mReference = reader.readText().replace(NEWLINE, SPACE);
    } else if (!state.mForUndo && (TAG_SKILL.equals(name) || TAG_SKILL_CONTAINER.equals(name))) {
        addChild(new Skill(mDataFile, reader, state));
    } else if (!state.mForUndo && Technique.TAG_TECHNIQUE.equals(name)) {
        addChild(new Technique(mDataFile, reader, state));
    } else if (!canHaveChildren()) {
        if (TAG_DIFFICULTY.equals(name)) {
            setDifficultyFromText(reader.readText().replace(NEWLINE, SPACE));
        } else if (TAG_POINTS.equals(name)) {
            mPoints = reader.readInteger(1);
        } else if (TAG_ENCUMBRANCE_PENALTY.equals(name)) {
            mEncumbrancePenaltyMultiplier = Math.min(Math.max(reader.readInteger(0), 0), 9);
        } else if (MeleeWeaponStats.TAG_ROOT.equals(name)) {
            mWeapons.add(new MeleeWeaponStats(this, reader));
        } else if (RangedWeaponStats.TAG_ROOT.equals(name)) {
            mWeapons.add(new RangedWeaponStats(this, reader));
        } else {
            super.loadSubElement(reader, state);
        }
    } else {
        super.loadSubElement(reader, state);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:40,代码来源:Skill.java

示例4: loadTag

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
boolean loadTag(XMLReader reader, String tag) throws IOException {
    if (TAG_PLAYER_NAME.equals(tag)) {
        mPlayerName = reader.readText();
    } else if (TAG_CAMPAIGN.equals(tag)) {
        mCampaign = reader.readText();
    } else if (TAG_NAME.equals(tag)) {
        mName = reader.readText();
    } else if (TAG_OLD_NOTES.equals(tag)) {
        Note note = new Note(mCharacter, false);
        note.setDescription(Text.standardizeLineEndings(reader.readText()));
        mCharacter.getNotesRoot().addRow(note, false);
    } else if (TAG_TITLE.equals(tag)) {
        mTitle = reader.readText();
    } else if (TAG_AGE.equals(tag)) {
        mAge = reader.readInteger(0);
    } else if (TAG_BIRTHDAY.equals(tag)) {
        mBirthday = reader.readText();
    } else if (TAG_EYES.equals(tag)) {
        mEyeColor = reader.readText();
    } else if (TAG_HAIR.equals(tag)) {
        mHair = reader.readText();
    } else if (TAG_SKIN.equals(tag)) {
        mSkinColor = reader.readText();
    } else if (TAG_HANDEDNESS.equals(tag)) {
        mHandedness = reader.readText();
    } else if (TAG_HEIGHT.equals(tag)) {
        mHeight = LengthValue.extract(reader.readText(), false);
    } else if (TAG_WEIGHT.equals(tag)) {
        mWeight = WeightValue.extract(reader.readText(), false);
    } else if (BonusAttributeType.SM.getXMLTag().equals(tag) || "size_modifier".equals(tag)) { //$NON-NLS-1$
        mSizeModifier = reader.readInteger(0);
    } else if (TAG_GENDER.equals(tag)) {
        mGender = reader.readText();
    } else if (TAG_RACE.equals(tag)) {
        mRace = reader.readText();
    } else if (TAG_BODY_TYPE.equals(tag)) {
        mHitLocationTable = HitLocationTable.MAP.get(reader.readText());
        if (mHitLocationTable == null) {
            mHitLocationTable = HitLocationTable.HUMANOID;
        }
    } else if (TAG_TECH_LEVEL.equals(tag)) {
        mTechLevel = reader.readText();
    } else if (TAG_RELIGION.equals(tag)) {
        mReligion = reader.readText();
    } else if (TAG_PORTRAIT.equals(tag)) {
        try {
            mPortrait = createPortrait(StdImage.loadImage(Base64.getMimeDecoder().decode(reader.readText())));
            mCustomPortrait = true;
        } catch (Exception imageException) {
            // Ignore
        }
    } else {
        return false;
    }
    return true;
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:57,代码来源:Profile.java

示例5: loadSelf

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
@Override
protected final void loadSelf(XMLReader reader, LoadState state) throws IOException {
    String marker = reader.getMarker();
    int unspentPoints = 0;

    characterInitialize(false);
    do {
        if (reader.next() == XMLNodeType.START_TAG) {
            String name = reader.getName();

            if (state.mDataFileVersion == 0) {
                if (mDescription.loadTag(reader, name)) {
                    continue;
                }
            }

            if (Profile.TAG_ROOT.equals(name)) {
                mDescription.load(reader);
            } else if (TAG_CREATED_DATE.equals(name)) {
                mCreatedOn = Numbers.extractDate(reader.readText());
            } else if (TAG_MODIFIED_DATE.equals(name)) {
                mLastModified = Numbers.extractDateTime(reader.readText());
            } else if (BonusAttributeType.HP.getXMLTag().equals(name)) {
                mHitPoints = reader.readInteger(0);
            } else if (TAG_CURRENT_HP.equals(name)) {
                mCurrentHitPoints = reader.readText();
            } else if (BonusAttributeType.FP.getXMLTag().equals(name)) {
                mFatiguePoints = reader.readInteger(0);
            } else if (TAG_CURRENT_FP.equals(name)) {
                mCurrentFatiguePoints = reader.readText();
            } else if (TAG_UNSPENT_POINTS.equals(name)) {
                unspentPoints = reader.readInteger(0);
            } else if (TAG_TOTAL_POINTS.equals(name)) {
                mTotalPoints = reader.readInteger(0);
            } else if (BonusAttributeType.ST.getXMLTag().equals(name)) {
                mStrength = reader.readInteger(0);
            } else if (BonusAttributeType.DX.getXMLTag().equals(name)) {
                mDexterity = reader.readInteger(0);
            } else if (BonusAttributeType.IQ.getXMLTag().equals(name)) {
                mIntelligence = reader.readInteger(0);
            } else if (BonusAttributeType.HT.getXMLTag().equals(name)) {
                mHealth = reader.readInteger(0);
            } else if (BonusAttributeType.WILL.getXMLTag().equals(name)) {
                mWill = reader.readInteger(0);
            } else if (BonusAttributeType.PERCEPTION.getXMLTag().equals(name)) {
                mPerception = reader.readInteger(0);
            } else if (BonusAttributeType.SPEED.getXMLTag().equals(name)) {
                mSpeed = reader.readDouble(0.0);
            } else if (BonusAttributeType.MOVE.getXMLTag().equals(name)) {
                mMove = reader.readInteger(0);
            } else if (TAG_INCLUDE_PUNCH.equals(name)) {
                mIncludePunch = reader.readBoolean();
            } else if (TAG_INCLUDE_KICK.equals(name)) {
                mIncludeKick = reader.readBoolean();
            } else if (TAG_INCLUDE_BOOTS.equals(name)) {
                mIncludeKickBoots = reader.readBoolean();
            } else if (AdvantageList.TAG_ROOT.equals(name)) {
                loadAdvantageList(reader, state);
            } else if (SkillList.TAG_ROOT.equals(name)) {
                loadSkillList(reader, state);
            } else if (SpellList.TAG_ROOT.equals(name)) {
                loadSpellList(reader, state);
            } else if (EquipmentList.TAG_ROOT.equals(name)) {
                loadEquipmentList(reader, state);
            } else if (NoteList.TAG_ROOT.equals(name)) {
                loadNoteList(reader, state);
            } else if (PrintManager.TAG_ROOT.equals(name)) {
                if (mPageSettings != null) {
                    mPageSettings.load(reader);
                }
            } else {
                reader.skipTag(name);
            }
        }
    } while (reader.withinMarker(marker));

    calculateAll();
    if (unspentPoints != 0) {
        setUnspentPoints(unspentPoints);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:82,代码来源:GURPSCharacter.java

示例6: loadSubElement

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
@Override
protected void loadSubElement(XMLReader reader, LoadState state) throws IOException {
    String name = reader.getName();
    if (TAG_NAME.equals(name)) {
        mName = reader.readText().replace(NEWLINE, SPACE);
        // Fix for legacy format...
        if (mName.toLowerCase().endsWith("(vh)")) { //$NON-NLS-1$
            mName = mName.substring(0, mName.length() - 4).trim();
            mIsVeryHard = true;
        }
    } else if (TAG_TECH_LEVEL.equals(name)) {
        mTechLevel = reader.readText();
        if (mTechLevel != null) {
            DataFile dataFile = getDataFile();
            if (dataFile instanceof ListFile || dataFile instanceof LibraryFile) {
                mTechLevel = EMPTY;
            }
        }
    } else if (TAG_REFERENCE.equals(name)) {
        mReference = reader.readText().replace(NEWLINE, SPACE);
    } else if (!state.mForUndo && (TAG_SPELL.equals(name) || TAG_SPELL_CONTAINER.equals(name))) {
        addChild(new Spell(mDataFile, reader, state));
    } else if (!canHaveChildren()) {
        if (TAG_COLLEGE.equals(name)) {
            mCollege = reader.readText().replace(NEWLINE, SPACE).replace("/ ", "/"); //$NON-NLS-1$ //$NON-NLS-2$
        } else if (TAG_POWER_SOURCE.equals(name)) {
            mPowerSource = reader.readText().replace(NEWLINE, SPACE);
        } else if (TAG_SPELL_CLASS.equals(name)) {
            mSpellClass = reader.readText().replace(NEWLINE, SPACE);
        } else if (TAG_CASTING_COST.equals(name)) {
            mCastingCost = reader.readText().replace(NEWLINE, SPACE);
        } else if (TAG_MAINTENANCE_COST.equals(name)) {
            mMaintenance = reader.readText().replace(NEWLINE, SPACE);
        } else if (TAG_CASTING_TIME.equals(name)) {
            mCastingTime = reader.readText().replace(NEWLINE, SPACE);
        } else if (TAG_DURATION.equals(name)) {
            mDuration = reader.readText().replace(NEWLINE, SPACE);
        } else if (TAG_POINTS.equals(name)) {
            mPoints = reader.readInteger(1);
        } else if (MeleeWeaponStats.TAG_ROOT.equals(name)) {
            mWeapons.add(new MeleeWeaponStats(this, reader));
        } else if (RangedWeaponStats.TAG_ROOT.equals(name)) {
            mWeapons.add(new RangedWeaponStats(this, reader));
        } else {
            super.loadSubElement(reader, state);
        }
    } else {
        super.loadSubElement(reader, state);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:51,代码来源:Spell.java

示例7: loadSubElement

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
@Override
protected void loadSubElement(XMLReader reader, LoadState state) throws IOException {
    String name = reader.getName();

    if (TAG_NAME.equals(name)) {
        mName = reader.readText().replace("\n", " "); //$NON-NLS-1$ //$NON-NLS-2$
    } else if (TAG_CR.equals(name)) {
        mCRAdj = Enums.extract(reader.getAttribute(SelfControlRoll.ATTR_ADJUSTMENT), SelfControlRollAdjustments.values(), SelfControlRollAdjustments.NONE);
        mCR = SelfControlRoll.get(reader.readText());
    } else if (TAG_REFERENCE.equals(name)) {
        mReference = reader.readText().replace("\n", " "); //$NON-NLS-1$ //$NON-NLS-2$
    } else if (!state.mForUndo && (TAG_ADVANTAGE.equals(name) || TAG_ADVANTAGE_CONTAINER.equals(name))) {
        addChild(new Advantage(mDataFile, reader, state));
    } else if (Modifier.TAG_MODIFIER.equals(name)) {
        mModifiers.add(new Modifier(getDataFile(), reader, state));
    } else if (!canHaveChildren()) {
        if (TAG_TYPE.equals(name)) {
            mType = getTypeFromText(reader.readText());
        } else if (TAG_LEVELS.equals(name)) {
            // Read the attribute first as next operation clears attribute map
            mHalfLevel = mAllowHalfLevels && reader.isAttributeSet(ATTR_HALF_LEVEL);
            mLevels = reader.readInteger(-1);
        } else if (TAG_OLD_POINTS.equals(name)) {
            mOldPointsString = reader.readText();
        } else if (TAG_BASE_POINTS.equals(name)) {
            mPoints = reader.readInteger(0);
        } else if (TAG_POINTS_PER_LEVEL.equals(name)) {
            mPointsPerLevel = reader.readInteger(0);
        } else if (MeleeWeaponStats.TAG_ROOT.equals(name)) {
            mWeapons.add(new MeleeWeaponStats(this, reader));
        } else if (RangedWeaponStats.TAG_ROOT.equals(name)) {
            mWeapons.add(new RangedWeaponStats(this, reader));
        } else if (OldWeapon.TAG_ROOT.equals(name)) {
            state.mOldWeapons.put(this, new OldWeapon(reader));
        } else {
            super.loadSubElement(reader, state);
        }
    } else {
        super.loadSubElement(reader, state);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:42,代码来源:Advantage.java


注:本文中的com.trollworks.toolkit.io.xml.XMLReader.readInteger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。