本文整理汇总了Java中org.dom4j.Element.elementText方法的典型用法代码示例。如果您正苦于以下问题:Java Element.elementText方法的具体用法?Java Element.elementText怎么用?Java Element.elementText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dom4j.Element
的用法示例。
在下文中一共展示了Element.elementText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import org.dom4j.Element; //导入方法依赖的package包/类
public void load(Element root) {
int version = Integer.parseInt(root.attributeValue("version"));
if (version==1) {
iJenrl = Double.parseDouble(root.elementText("jenrl"));
iIsSatisfied = Boolean.valueOf(root.elementText("satisfied")).booleanValue();
iIsDistance = Boolean.valueOf(root.elementText("dist")).booleanValue();
iIsFixed = Boolean.valueOf(root.elementText("fixed")).booleanValue();
iIsHard = Boolean.valueOf(root.elementText("hard")).booleanValue();
if (root.elementText("distance")!=null)
iDistance = Double.parseDouble(root.elementText("distance"));
if (root.elementText("commited")==null) {
iIsCommited = false;
} else {
iIsCommited = Boolean.valueOf(root.elementText("commited")).booleanValue();
}
if (root.elementText("important")==null) {
iIsImportant = false;
} else {
iIsImportant = Boolean.valueOf(root.elementText("important")).booleanValue();
}
if (root.elementText("instructor")==null) {
iIsInstructor = false;
} else {
iIsInstructor = Boolean.valueOf(root.elementText("instructor")).booleanValue();
}
}
}
示例2: load
import org.dom4j.Element; //导入方法依赖的package包/类
public void load(Element root) {
int version = Integer.parseInt(root.attributeValue("version"));
if (version==1) {
if (root.element("name")!=null)
iName = root.element("name").getText();
iPreference = root.element("pref").getText();
iIsSatisfied = Boolean.valueOf(root.element("isSatisfied").getText()).booleanValue();
iType = root.elementText("type");
}
}
示例3: load
import org.dom4j.Element; //导入方法依赖的package包/类
public void load(Element root) {
int version = Integer.parseInt(root.attributeValue("version"));
if (version==sVersion) {
iNormalizedTimePreference = Double.parseDouble(root.elementText("normTimePref"));
iBestNormalizedTimePreference = Double.parseDouble(root.elementText("bestNormTimePref"));
iTimePreference = Integer.parseInt(root.elementText("timePref"));
for (Iterator i=root.elementIterator("roomPref");i.hasNext();) {
Element e = (Element)i.next();
iRoomPreference.put(Long.valueOf(e.attributeValue("id")),Integer.valueOf(e.getText()));
}
iBestRoomPreference = Integer.parseInt(root.elementText("bestRoomPref"));
iNrStudentConflicts = Integer.parseInt(root.elementText("nrStudentConf"));
iNrHardStudentConflicts = Integer.parseInt(root.elementText("nrHardStudentConf"));
iNrDistanceStudentConflicts = Integer.parseInt(root.elementText("nrDistanceStudentConf"));
iNrCommitedStudentConflicts = Integer.parseInt(root.elementText("nrCommitedStudentConf"));
iNrTimeLocations = Integer.parseInt(root.elementText("nrTimeLoc"));
iNrRoomLocations = Integer.parseInt(root.elementText("nrRoomLoc"));
iNrSameRoomPlacementsNoConf = Integer.parseInt(root.elementText("nrSameRoomPlacNoConf"));
iNrSameTimePlacementsNoConf = Integer.parseInt(root.elementText("nrSameTimePlacNoConf"));
iNrPlacementsNoConf = Integer.parseInt(root.elementText("nrPlacNoConf"));
iBtbInstructorPreference = Integer.parseInt(root.elementText("btbInstrPref"));
iIsInitial = Boolean.valueOf(root.elementText("isInitial")).booleanValue();
iInitialAssignment = root.elementText("iniAssign");
iHasInitialSameTime = Boolean.valueOf(root.elementText("hasIniSameTime")).booleanValue();
iHasInitialSameRoom = Boolean.valueOf(root.elementText("hasIniSameRoom")).booleanValue();
iPerturbationPenalty = Double.parseDouble(root.elementText("pertPenalty"));
iTooBigRoomPreference = Integer.parseInt(root.elementText("tooBig"));
iMinRoomSize = Long.parseLong(root.elementText("minSize"));
iUselessHalfHours = Integer.parseInt(root.elementText("uselessHalfHours"));
iDeptBalancPenalty = Double.parseDouble(root.elementText("deptBalanc"));
iGroupConstraintPref = Integer.parseInt(root.elementText("groupConstr"));
if (root.elementText("spread")!=null)
iSpreadPenalty = Double.parseDouble(root.elementText("spread"));
if (root.elementText("maxSpread")!=null)
iMaxSpreadPenalty = Double.parseDouble(root.elementText("maxSpread"));
else
iMaxSpreadPenalty = iSpreadPenalty;
if (root.elementText("maxDeptBalanc")!=null)
iMaxDeptBalancPenalty = Integer.parseInt(root.elementText("maxDeptBalanc"));
else
iMaxDeptBalancPenalty = (int)iDeptBalancPenalty;
if (root.elementText("datePref") != null)
iDatePatternPref = Integer.parseInt(root.elementText("datePref"));
if (root.elementText("studentGroupPercent") != null)
iStudentGroupPercent = Integer.valueOf(root.elementText("studentGroupPercent"));
iStudentGroupComment = root.elementText("studentGroupComment");
}
}