Class ScannerKit
java.lang.Object
com.iohao.net.extension.client.kit.ScannerKit
Console input helper utilities for simulated clients.
- Author:
- 渔民小镇
- date:
- 2023-07-04
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSkips the runnable when console input is disabled.intnextInt()Reads anintfrom console input.intnextInt(int defaultValue) Reads anintfrom console input.nextLine()Reads aStringfrom console input.Reads aStringfrom console input.longnextLong()Reads alongfrom console input.longnextLong(long defaultValue) Reads alongfrom console input.
-
Constructor Details
-
ScannerKit
public ScannerKit()
-
-
Method Details
-
log
Skips the runnable when console input is disabled.- Parameters:
runnable- runnable
-
nextLine
-
nextLine
-
nextLong
public 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 long nextLong()Reads alongfrom console input.- Returns:
- long value
-
nextInt
public 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 int nextInt()Reads anintfrom console input.- Returns:
- int value
-