Java Code Examples for org.dom4j.Element.elementText()

The following are Jave code examples for showing how to use elementText() of the org.dom4j.Element class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: unitimes   File: JenrlInfo.java   Source Code and License Vote up 5 votes
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();
		}
	}
}
 
Example 2
Project: unitimes   File: GroupConstraintInfo.java   Source Code and License Vote up 5 votes
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");
	}
}
 
Example 3
Project: unitimes   File: AssignmentPreferenceInfo.java   Source Code and License Vote up 4 votes
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");
	}
}