Class ScannerKit
java.lang.Object
com.iohao.net.extension.client.kit.ScannerKit
Console input helper utilities for simulated clients.
- Author:
- 渔民小镇
- date:
- 2023-07-04
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidSkips the runnable when console input is disabled.static intnextInt()Reads anintfrom console input.static intnextInt(int defaultValue) Reads anintfrom console input.static StringnextLine()Reads aStringfrom console input.static StringReads aStringfrom console input.static longnextLong()Reads alongfrom console input.static longnextLong(long defaultValue) Reads alongfrom console input.
-
Method Details
-
log
Skips the runnable when console input is disabled.- Parameters:
runnable- runnable
-
nextLine
-
nextLine
-
nextLong
public static long nextLong(long defaultValue) Reads alongfrom console input.If console input is disabled, returns the default value.- Parameters:
defaultValue- default value when console input is disabled- Returns:
- long value
-
nextLong
public static long nextLong()Reads alongfrom console input.- Returns:
- long value
-
nextInt
public static int nextInt(int defaultValue) Reads anintfrom console input.If console input is disabled, returns the default value.- Parameters:
defaultValue- default value when console input is disabled- Returns:
- int value
-
nextInt
public static int nextInt()Reads anintfrom console input.- Returns:
- int value
-