本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}