Java Scanner Read getThreadScanner()

Here you can find the source of getThreadScanner()

Description

get Thread Scanner

License

Open Source License

Declaration

private static Scanner getThreadScanner() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    private static Map<Long, Scanner> map = new HashMap<>();

    private static Scanner getThreadScanner() {
        long threadId = Thread.currentThread().getId();
        Scanner keyboardScanner = map.get(threadId);
        return keyboardScanner;
    }/*from  w ww  .  j  a v a  2s  . c om*/
}

Related

  1. getStreamLines(final InputStream is)
  2. load(Class cls, String location)
  3. load(File in)
  4. load(final String fileName)
  5. load(InputStream in, int elementCountOverride)