gpt4 book ai didi

com.koolearn.klibrary.core.filesystem.ZLFile.children()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 12:11:14 28 4
gpt4 key购买 nike

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

ZLFile.children介绍

暂无

代码示例

代码示例来源:origin: ydcx/KooReader

public static List<String> languageCodes() {
  synchronized (ourLanguageCodes) {
    if (ourLanguageCodes.isEmpty()) {
      final ZLFile dir = ZLResourceFile.createResourceFile("resources/application");
      final List<ZLFile> children = dir.children();
      for (ZLFile file : children) {
        final String name = file.getShortName();
        final String postfix = ".xml";
        if (name.endsWith(postfix) && !"neutral.xml".equals(name)) {
          ourLanguageCodes.add(name.substring(0, name.length() - postfix.length()));
        }
      }
    }
  }
  return Collections.unmodifiableList(ourLanguageCodes);
}

代码示例来源:origin: Jiangzqts/EpubRead

private void addChildren(ZLFile file) {
    for (ZLFile child : file.children()) {
      final FileInfo info = get(child);
      if (myInfosToRemove.contains(info)) {
        myInfosToRemove.remove(info);
      } else {
        myInfosToSave.add(info);
      }
      addChildren(child);
    }
  }
}

代码示例来源:origin: ydcx/KooReader

public List<String> languageCodes() {
  if (myLanguageCodes == null) {
    final TreeSet<String> codes = new TreeSet<String>();
    final ZLFile patternsFile = ZLResourceFile.createResourceFile("hyphenationPatterns");
    for (ZLFile file : patternsFile.children()) {
      final String name = file.getShortName();
      if (name.endsWith(".pattern")) {
        codes.add(name.substring(0, name.length() - ".pattern".length()));
      }
    }
    codes.add("zh");
    myLanguageCodes = new ArrayList<String>(codes);
  }
  return Collections.unmodifiableList(myLanguageCodes);
}

代码示例来源:origin: ydcx/KooReader

private void addChildren(ZLFile file) {
    for (ZLFile child : file.children()) {
      final FileInfo info = get(child);
      if (myInfosToRemove.contains(info)) {
        myInfosToRemove.remove(info);
      } else {
        myInfosToSave.add(info);
      }
      addChildren(child);
    }
  }
}

代码示例来源:origin: Jiangzqts/EpubRead

public List<String> languageCodes() {
  if (myLanguageCodes == null) {
    final TreeSet<String> codes = new TreeSet<String>();
    final ZLFile patternsFile = ZLResourceFile.createResourceFile("hyphenationPatterns");
    for (ZLFile file : patternsFile.children()) {
      final String name = file.getShortName();
      if (name.endsWith(".pattern")) {
        codes.add(name.substring(0, name.length() - ".pattern".length()));
      }
    }
    codes.add("zh");
    myLanguageCodes = new ArrayList<String>(codes);
  }
  return Collections.unmodifiableList(myLanguageCodes);
}

代码示例来源:origin: Jiangzqts/EpubRead

public static List<String> languageCodes() {
  synchronized (ourLanguageCodes) {
    if (ourLanguageCodes.isEmpty()) {
      final ZLFile dir = ZLResourceFile.createResourceFile("resources/application");
      final List<ZLFile> children = dir.children();
      for (ZLFile file : children) {
        final String name = file.getShortName();
        final String postfix = ".xml";
        if (name.endsWith(postfix) && !"neutral.xml".equals(name)) {
          ourLanguageCodes.add(name.substring(0, name.length() - postfix.length()));
        }
      }
    }
  }
  return Collections.unmodifiableList(ourLanguageCodes);
}

代码示例来源:origin: Jiangzqts/EpubRead

public static List<String> languageCodes() {
  if (ourLanguageCodes.isEmpty()) {
    TreeSet<String> codes = new TreeSet<String>();
    for (ZLFile file : patternsFile().children()) {
      String name = file.getShortName();
      LogInfo.i("language"+name);
      final int index = name.indexOf("_");
      if (index != -1) {
        String str = name.substring(0, index);
        if (!codes.contains(str)) {
          codes.add(str);
        }
      }
    }
    codes.add("id");
    codes.add("de-traditional");
    ourLanguageCodes.addAll(codes);
  }
  return Collections.unmodifiableList(ourLanguageCodes);
}

代码示例来源:origin: ydcx/KooReader

public static List<String> languageCodes() {
  if (ourLanguageCodes.isEmpty()) {
    TreeSet<String> codes = new TreeSet<String>();
    for (ZLFile file : patternsFile().children()) {
      String name = file.getShortName();
      LogInfo.i("language"+name);
      final int index = name.indexOf("_");
      if (index != -1) {
        String str = name.substring(0, index);
        if (!codes.contains(str)) {
          codes.add(str);
        }
      }
    }
    codes.add("id");
    codes.add("de-traditional");
    ourLanguageCodes.addAll(codes);
  }
  return Collections.unmodifiableList(ourLanguageCodes);
}

代码示例来源:origin: ydcx/KooReader

public boolean canRemoveBook(DbBook book, boolean deleteFromDisk) {
  if (deleteFromDisk) {
    ZLFile file = book.File;
    if (file.getPhysicalFile() == null) {
      return false;
    }
    while (file instanceof ZLArchiveEntryFile) {
      file = file.getParent();
      if (file.children().size() != 1) {
        return false;
      }
    }
    return true;
  } else {
    // TODO: implement
    return false;
  }
}

代码示例来源:origin: Jiangzqts/EpubRead

public boolean canRemoveBook(DbBook book, boolean deleteFromDisk) {
  if (deleteFromDisk) {
    ZLFile file = book.File;
    if (file.getPhysicalFile() == null) {
      return false;
    }
    while (file instanceof ZLArchiveEntryFile) {
      file = file.getParent();
      if (file.children().size() != 1) {
        return false;
      }
    }
    return true;
  } else {
    // TODO: implement
    return false;
  }
}

代码示例来源:origin: ydcx/KooReader

@Override
public void waitForOpening() {
  if (getBook() != null) {
    return;
  }
  final TreeSet<ZLFile> set = new TreeSet<ZLFile>(ourFileComparator);
  for (ZLFile file : myFile.children()) {
    if (file.isDirectory() || file.isArchive() ||
      Collection.getBookByFile(file.getPath()) != null) {
      set.add(file);
    }
  }
  clear();
  for (ZLFile file : set) {
    new FileTree(this, file);
  }
}

代码示例来源:origin: Jiangzqts/EpubRead

@Override
public void waitForOpening() {
  if (getBook() != null) {
    return;
  }
  final TreeSet<ZLFile> set = new TreeSet<ZLFile>(ourFileComparator);
  for (ZLFile file : myFile.children()) {
    if (file.isDirectory() || file.isArchive() ||
      Collection.getBookByFile(file.getPath()) != null) {
      set.add(file);
    }
  }
  clear();
  for (ZLFile file : set) {
    new FileTree(this, file);
  }
}

代码示例来源:origin: ydcx/KooReader

private Book createBookForFile(ZLFile file) {
  if (file == null) {
    return null;
  }
  Book book = myKooReaderApp.Collection.getBookByFile(file.getPath());
  if (book != null) {
    return book;
  }
  if (file.isArchive()) {
    for (ZLFile child : file.children()) {
      book = myKooReaderApp.Collection.getBookByFile(child.getPath());
      if (book != null) {
        return book;
      }
    }
  }
  return null;
}

代码示例来源:origin: Jiangzqts/EpubRead

private Book createBookForFile(ZLFile file) {
  if (file == null) {
    return null;
  }
  Book book = myKooReaderApp.Collection.getBookByFile(file.getPath());
  if (book != null) {
    return book;
  }
  if (file.isArchive()) {
    for (ZLFile child : file.children()) {
      book = myKooReaderApp.Collection.getBookByFile(child.getPath());
      if (book != null) {
        return book;
      }
    }
  }
  return null;
}

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