本文整理匯總了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");
}
}