2019.4.31

    技术2022-07-20  79

    2019.4.31

    public static Callable<Path> searchForTask(String word, Path path){ return () -> { try(var in = new Scanner(path)){ while(in.hasNext()){ if(in.next().equals(word)) return path; if(Thread.currentThread().isInterrupted()){ System.out.println("Search in "+path+" canceled."); return null; } } throw new NoSuchElementException(); } }; }

    Processed: 0.024, SQL: 9