本文整理汇总了Java中com.trollworks.toolkit.io.xml.XMLReader.readDouble方法的典型用法代码示例。如果您正苦于以下问题:Java XMLReader.readDouble方法的具体用法?Java XMLReader.readDouble怎么用?Java XMLReader.readDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.trollworks.toolkit.io.xml.XMLReader
的用法示例。
在下文中一共展示了XMLReader.readDouble方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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);
}
}
示例3: load
import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
/** @param reader The reader to load data from. */
public void load(XMLReader reader) throws IOException {
mPerLevel = reader.isAttributeSet(ATTRIBUTE_PER_LEVEL);
mAmount = reader.readDouble(0.0);
}
示例4: 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);
}
}
示例5: getNumber
import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
private static double getNumber(XMLReader reader, LengthUnits units, double defInches) throws IOException {
return reader.readDouble(units.convert(LengthUnits.IN, defInches));
}