本文整理汇总了Java中nu.xom.Elements.size方法的典型用法代码示例。如果您正苦于以下问题:Java Elements.size方法的具体用法?Java Elements.size怎么用?Java Elements.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nu.xom.Elements
的用法示例。
在下文中一共展示了Elements.size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAllNotes
import nu.xom.Elements; //导入方法依赖的package包/类
public Collection getAllNotes() {
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 n = (NoteElement) ns.get(ni);
v.add(new NoteImpl(n.getElement(), _project));
}
}
}
}
return v;
}
示例2: getTimeLogsForDate
import nu.xom.Elements; //导入方法依赖的package包/类
public static Collection getTimeLogsForDate(CalendarDate date) throws Exception {
refresh();
Vector v = new Vector();
Day d = getDay(date);
if (d != null) {
Elements els = d.getElement().getChildElements(CHILD_ELEMENT);
for (int i = 0; i < els.size(); i++)
v.add(new TimeLog(els.get(i)));
}
Collections.sort(v);
return v;
}
示例3: 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);
}
示例4: removeSticker
import nu.xom.Elements; //导入方法依赖的package包/类
public static void removeSticker(String stickerId) {
Elements els = _root.getChildElements("sticker");
for (int i = 0; i < els.size(); i++) {
Element se = els.get(i);
if (se.getAttribute("id").getValue().equals(stickerId)) {
_root.removeChild(se);
break;
}
}
}
示例5: getAllProjects
import nu.xom.Elements; //导入方法依赖的package包/类
public static Vector<Project> getAllProjects() {
Elements prjs = _root.getChildElements("project");
Vector<Project> v = new Vector<Project>();
for (int i = 0; i < prjs.size(); i++)
v.add(new ProjectImpl((Element) prjs.get(i)));
return v;
}
示例6: 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;
}
示例7: hasSubTasks
import nu.xom.Elements; //导入方法依赖的package包/类
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;
}
示例8: 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;
}
示例9: getProject
import nu.xom.Elements; //导入方法依赖的package包/类
public static Project getProject(String id) {
Elements prjs = _root.getChildElements("project");
for (int i = 0; i < prjs.size(); i++) {
String pid = ((Element) prjs.get(i)).getAttribute("id").getValue();
if (pid.equals(id)) {
return new ProjectImpl((Element) prjs.get(i));
}
}
return null;
}
示例10: buildElements
import nu.xom.Elements; //导入方法依赖的package包/类
private void buildElements(Element parent) {
Elements els = parent.getChildElements("timelog");
for (int i = 0; i < els.size(); i++) {
Element el = els.get(i);
elements.put(el.getAttribute("id").getValue(), el);
buildElements(el);
}
}
示例11: getMimeTypeByExt
import nu.xom.Elements; //导入方法依赖的package包/类
public static MimeType getMimeTypeByExt(String ext) {
Elements els = _root.getChildElements("mime-type");
for (int i = 0; i < els.size(); i++) {
Element el = els.get(i);
Elements exts = el.getChildElements("ext");
for (int j = 0; j < exts.size(); j++)
if (exts.get(j).getValue().toLowerCase().equals(ext.toLowerCase()))
return new MimeType(el);
}
return new MimeType();
}
示例12: getNotesForPeriod
import nu.xom.Elements; //导入方法依赖的package包/类
public Collection getNotesForPeriod(CalendarDate startDate, CalendarDate endDate) {
Vector v = new Vector();
Elements yrs = _root.getChildElements("year");
for (int yi = 0; yi < yrs.size(); yi++) {
Year y = new Year(yrs.get(yi));
if ((y.getValue() >= startDate.getYear()) && (y.getValue() <= endDate.getYear())) {
Vector months = y.getMonths();
for (int mi = 0; mi < months.size(); mi++) {
Month m = (Month) months.get(mi);
if (!((y.getValue() == startDate.getYear()) && (m.getValue() < startDate.getMonth()))
|| !((y.getValue() == endDate.getYear()) && (m.getValue() > endDate.getMonth()))) {
Vector days = m.getDays();
for (int di = 0; di < days.size(); di++) {
Day d = (Day) days.get(di);
if (!((m.getValue() == startDate.getMonth()) && (d.getValue() < startDate.getDay()))
|| !((m.getValue() == endDate.getMonth()) && (d.getValue() > endDate.getDay()))) {
Vector ns = d.getNotes();
for(int ni = 0; ni < ns.size(); ni++) {
NoteElement n = (NoteElement) ns.get(ni);
v.add(new NoteImpl(n.getElement(), _project));
}
}
}
}
}
}
}
return v;
}
示例13: 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;
}
示例14: getMimeType
import nu.xom.Elements; //导入方法依赖的package包/类
public static MimeType getMimeType(String mimeId) {
Elements els = _root.getChildElements("mime-type");
for (int i = 0; i < els.size(); i++)
if (els.get(i).getAttribute("id").getValue().equals(mimeId))
return new MimeType(els.get(i));
return new MimeType();
}
示例15: getNotes
import nu.xom.Elements; //导入方法依赖的package包/类
public Vector getNotes() {
if (dEl == null)
return null;
Vector v = new Vector();
Elements ds = dEl.getChildElements("note");
for (int i = 0; i < ds.size(); i++)
v.add(new NoteElement(ds.get(i)));
return v;
}