gpt4 book ai didi

pl.edu.icm.model.bwmeta.y.YContentEntry.isDirectory()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 16:38:40 30 4
gpt4 key购买 nike

本文整理了Java中pl.edu.icm.model.bwmeta.y.YContentEntry.isDirectory()方法的一些代码示例,展示了YContentEntry.isDirectory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YContentEntry.isDirectory()方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YContentEntry
类名称:YContentEntry
方法名:isDirectory

YContentEntry.isDirectory介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

private List<YContentFile> processPlainTextEntry(final YContentEntry<?> yEntry) {
  final List<YContentFile> result = new ArrayList<YContentFile>();
  if (yEntry.isDirectory()) {
    final YContentDirectory yDirectory = (YContentDirectory) yEntry;
    for (final YContentEntry<?> yChild : yDirectory.getEntries()) {
      result.addAll(processPlainTextEntry(yChild));
    }
  } else if (yEntry.isFile() && YConstants.FT_PLAIN_TEXT.equals(((YContentFile) yEntry).getType())) {
    result.add((YContentFile) yEntry);
  }
  return result;
}

代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core

@SuppressWarnings("rawtypes")
private List<ContentInfo> getContentInfo(YContentEntry entry){
  if(entry.isDirectory()){
    return getContentInfo((YContentDirectory) entry);
  } else {
    return getContentInfo((YContentFile) entry);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

private YContentDirectory findChapter(String id, YElement elements, List<String> chapters) {
    Queue<YContentEntry> fifo = new LinkedList<YContentEntry>();
    YContentDirectory foundChapter = null;
    fifo.addAll(elements.getContents());
    while (!fifo.isEmpty()) {
      YContentEntry e = fifo.poll();
      if (e.isDirectory()) {
        YContentDirectory dir = (YContentDirectory) e;
        if (dir.getType().equals(YConstants.CONTENT_PAGED)) {
          chapters.add(dir.getId());
          if (id == null) {
            if (foundChapter == null) {
              foundChapter = dir;
            }
          } else if (id.equals(dir.getId())) {
            foundChapter = dir;
          }
        } else {
          fifo.addAll(dir.getEntries());
        }
      }
    }
    return foundChapter;
  }
}

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com