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


Java Elements类代码示例

本文整理汇总了Java中nu.xom.Elements的典型用法代码示例。如果您正苦于以下问题:Java Elements类的具体用法?Java Elements怎么用?Java Elements使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: addOrReplaceApp

import nu.xom.Elements; //导入依赖的package包/类
public void addOrReplaceApp(String appId, String fp, String exec, String clp) {
    Elements apps = _root.getChildElements("app");
    for (int i = 0; i < apps.size(); i++)
        if (apps.get(i).getAttribute("id").getValue().equals(appId)) {
             if (apps.get(i).getAttribute("findPath") == null)
              apps.get(i).addAttribute(new Attribute("findPath", fp));
             else
              apps.get(i).getAttribute("findPath").setValue(fp);
             if (apps.get(i).getAttribute("exec") == null)
              apps.get(i).addAttribute(new Attribute("exec", exec));
             else
              apps.get(i).getAttribute("exec").setValue(exec);
            if (apps.get(i).getAttribute("command") == null)
              apps.get(i).addAttribute(new Attribute("command", clp));
            else
              apps.get(i).getAttribute("command").setValue(clp);
            return;
        }
    addApp(appId, fp, exec, clp);
}
 
开发者ID:ser316asu,项目名称:SER316-Munich,代码行数:21,代码来源:AppList.java

示例2: getMarkedNotes

import nu.xom.Elements; //导入依赖的package包/类
/**
    * @see net.sf.memoranda.NoteList#getMarkedNotes()
    */
   public Collection getMarkedNotes() {
       Vector v = new Vector();
       Elements yrs = _root.getChildElements("year");
       for (int yi = 0; yi < yrs.size(); yi++) {
           Year y = new Year(yrs.get(yi));
           Vector ms = y.getMonths();
           for (int mi = 0; mi < ms.size(); mi++) {
               Month m = (Month) ms.get(mi);
               Vector ds = m.getDays();
               for (int di = 0; di < ds.size(); di++) {
                   Day d = (Day) ds.get(di);
				Vector ns = d.getNotes();
				for(int ni = 0; ni < ns.size(); ni++) {
					NoteElement ne = (NoteElement) ns.get(ni);
					Note n = new NoteImpl(ne.getElement(), _project);
					if (n.isMarked()) v.add(n);
               }
           }
       }
   }
        return v;
}
 
开发者ID:ser316asu,项目名称:SER316-Aachen,代码行数:26,代码来源:NoteListImpl.java

示例3: getEventsForDate

import nu.xom.Elements; //导入依赖的package包/类
public static Collection getEventsForDate(CalendarDate date) {
	Vector v = new Vector();
	Day d = getDay(date);
	if (d != null) {
		Elements els = d.getElement().getChildElements("event");
		for (int i = 0; i < els.size(); i++)
			v.add(new EventImpl(els.get(i)));
	}
	Collection r = getRepeatableEventsForDate(date);
	if (r.size() > 0)
		v.addAll(r);
	//EventsVectorSorter.sort(v);
	Collections.sort(v);
	return v;
}
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:16,代码来源:EventsManager.java

示例4: getMarkedNotes

import nu.xom.Elements; //导入依赖的package包/类
/**
 * @see net.sf.memoranda.NoteList#getMarkedNotes()
 */
public Collection getMarkedNotes() {
	Vector v = new Vector();
	Elements yrs = _root.getChildElements("year");
	for (int yi = 0; yi < yrs.size(); yi++) {
		Year y = new Year(yrs.get(yi));
		Vector ms = y.getMonths();
		for (int mi = 0; mi < ms.size(); mi++) {
			Month m = (Month) ms.get(mi);
			Vector ds = m.getDays();
			for (int di = 0; di < ds.size(); di++) {
				Day d = (Day) ds.get(di);
				Vector ns = d.getNotes();
				for (int ni = 0; ni < ns.size(); ni++) {
					NoteElement ne = (NoteElement) ns.get(ni);
					Note n = new NoteImpl(ne.getElement(), _project);
					if (n.isMarked())
						v.add(n);
				}
			}
		}
	}
	return v;
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:27,代码来源:NoteListImpl.java

示例5: getMonths

import nu.xom.Elements; //导入依赖的package包/类
public Vector getMonths() {
    Vector v = new Vector();
    Elements ms = yearElement.getChildElements("month");
    for (int i = 0; i < ms.size(); i++)
        v.add(new Month(ms.get(i)));
    return v;
}
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:8,代码来源:NoteListImpl.java

示例6: getDays

import nu.xom.Elements; //导入依赖的package包/类
public Vector getDays() {
    if (mElement == null)
        return null;
    Vector v = new Vector();
    Elements ds = mElement.getChildElements("day");
    for (int i = 0; i < ds.size(); i++)
        v.add(new Day(ds.get(i)));
    return v;
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:10,代码来源:NoteListImpl.java

示例7: getExtensions

import nu.xom.Elements; //导入依赖的package包/类
public String[] getExtensions() {
    Vector v = new Vector();
    String[] ss = {};
    Elements exts = _root.getChildElements("ext");
    for (int i = 0; i < exts.size(); i++)
        v.add(exts.get(i).getValue());
    return (String[]) v.toArray(ss);
}
 
开发者ID:ser316asu,项目名称:SER316-Ingolstadt,代码行数:9,代码来源:MimeType.java

示例8: hasSubTasks

import nu.xom.Elements; //导入依赖的package包/类
/**
 * @see net.sf.memoranda.Task#hasSubTasks()
 */
public boolean hasSubTasks(String id) {
    Elements subTasks = _element.getChildElements("task");
    for (int i = 0; i < subTasks.size(); i++) 
        if (subTasks.get(i).getAttribute("id").getValue().equals(id))
            return true;
    return false;
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:11,代码来源:TaskImpl.java

示例9: setExec

import nu.xom.Elements; //导入依赖的package包/类
public void setExec(String appId, String e) {
    Elements apps = _root.getChildElements("app");
    for (int i = 0; i < apps.size(); i++)
        if (apps.get(i).getAttribute("id").getValue().equals(appId)){
          if (apps.get(i).getAttribute("exec") == null)
            apps.get(i).addAttribute(new Attribute("exec", e));
          else
            apps.get(i).getAttribute("exec").setValue(e);
        }
}
 
开发者ID:ser316asu,项目名称:SER316-Aachen,代码行数:11,代码来源:AppList.java

示例10: getAllProjectsNumber

import nu.xom.Elements; //导入依赖的package包/类
public static int getAllProjectsNumber() {
int i;
      try {
	i = ((Elements)_root.getChildElements("project")).size();
}
catch (NullPointerException e) {
	i = 1;
}
return i;
  }
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:11,代码来源:ProjectManager.java

示例11: getExec

import nu.xom.Elements; //导入依赖的package包/类
public String getExec(String appId) {
    Elements apps = _root.getChildElements("app");
    for (int i = 0; i < apps.size(); i++)
        if (apps.get(i).getAttribute("id").getValue().equals(appId))
            return apps.get(i).getAttribute("exec").getValue();
    return null;
}
 
开发者ID:ser316asu,项目名称:SER316-Ingolstadt,代码行数:8,代码来源:AppList.java

示例12: buildElements

import nu.xom.Elements; //导入依赖的package包/类
private void buildElements(Element parent) {
	Elements els = parent.getChildElements("task");
	for (int i = 0; i < els.size(); i++) {
		Element el = els.get(i);
		elements.put(el.getAttribute("id").getValue(), el);
		buildElements(el);
	}
}
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:9,代码来源:TaskListImpl.java

示例13: getEvent

import nu.xom.Elements; //导入依赖的package包/类
public static Event getEvent(CalendarDate date, int hh, int mm) {
	Day d = getDay(date);
	if (d == null)
		return null;
	Elements els = d.getElement().getChildElements("event");
	for (int i = 0; i < els.size(); i++) {
		Element el = els.get(i);
		if ((new Integer(el.getAttribute("hour").getValue()).intValue()
			== hh)
			&& (new Integer(el.getAttribute("min").getValue()).intValue()
				== mm))
			return new EventImpl(el);
	}
	return null;
}
 
开发者ID:ser316asu,项目名称:SER316-Aachen,代码行数:16,代码来源:EventsManager.java

示例14: getRepeatableEvents

import nu.xom.Elements; //导入依赖的package包/类
public static Collection getRepeatableEvents() {
	Vector v = new Vector();
	Element rep = _root.getFirstChildElement("repeatable");
	if (rep == null)
		return v;
	Elements els = rep.getChildElements("event");
	for (int i = 0; i < els.size(); i++)
		v.add(new EventImpl(els.get(i)));
	return v;
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:11,代码来源:EventsManager.java

示例15: getSubTask

import nu.xom.Elements; //导入依赖的package包/类
public Task getSubTask(String id) {
	Elements subTasks = _element.getChildElements("task");
	for (int i = 0; i < subTasks.size(); i++) {
		if (subTasks.get(i).getAttribute("id").getValue().equals(id))
			return new TaskImpl(subTasks.get(i), _tl);
	}
	return null;
}
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:9,代码来源:CommitImpl.java


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