Codota Logo
TextIO.newIntInputReader
Code IndexAdd Codota to your IDE (free)

How to use
newIntInputReader
method
in
org.beryx.textio.TextIO

Best Java code snippets using org.beryx.textio.TextIO.newIntInputReader (Showing top 8 results out of 315)

  • Common ways to obtain TextIO
private void myMethod () {
TextIO t =
  • Codota IconTextTerminal textTerminal;new TextIO(textTerminal)
  • Smart code suggestions by Codota
}
origin: beryx/text-io

private static void configurePort(TextIO textIO, WebTextIoExecutor webTextIoExecutor, int defaultPort) {
  int port = textIO.newIntInputReader()
      .withDefaultValue(defaultPort)
      .read("Server port number");
  webTextIoExecutor.withPort(port);
}
origin: mars-sim/mars-sim

  private void addJobTask(TextIO textIO, String prompt, Supplier<Integer> defaultValueSupplier, Consumer<Integer> valueSetter) {
    operations.add(() -> {
      setChoices();
      valueSetter.accept(textIO.newIntInputReader()
          .withDefaultValue(5)
//                .withDefaultValue(defaultValueSupplier.get())
        .withMinVal(1)
        .withMaxVal(16)
        .read(prompt));
      });
  }
  
origin: mars-sim/mars-sim

private void addCountryTask(TextIO textIO, String prompt, Supplier<Integer> defaultValueSupplier, Consumer<Integer> valueSetter) {
  operations.add(() -> {
    setChoices();
    valueSetter.accept(textIO.newIntInputReader()
      .withDefaultValue(5)
      .withMinVal(1)
      .withMaxVal(28)//defaultValueSupplier.get())
      .read(prompt));
    });
}
origin: mars-sim/mars-sim

  private void addAge(TextIO textIO, String prompt, Supplier<Integer> defaultValueSupplier, Consumer<Integer> valueSetter) {
    operations.add(() -> {
      setChoices();
      valueSetter.accept(textIO.newIntInputReader()       
        .withDefaultValue(30) //
//                .withDefaultValue(defaultValueSupplier.get())
//                .withPromptAdjustments(false)
//                .withNumberedPossibleValues(age)
        .withMaxVal(80)
        .withMinVal(18) 
        .read(prompt));
      });
  }

origin: mars-sim/mars-sim

    + "Which timestamp do you want to use (1, 2 or 3)?";
int choice = sim.getTerm().getTextIO().newIntInputReader().read(prompt1);
origin: mars-sim/mars-sim

this.intInputReaderSupplier = () -> textIO.newIntInputReader();
this.longInputReaderSupplier = () -> textIO.newLongInputReader();
this.doubleInputReaderSupplier = () -> textIO.newDoubleInputReader();
origin: beryx/text-io

@Override
public void accept(TextIO textIO, RunnerData runnerData) {
  TextTerminal<?> terminal = textIO.getTextTerminal();
  String initData = (runnerData == null) ? null : runnerData.getInitData();
  AppUtil.printGsonMessage(terminal, initData);
  String user = textIO.newStringInputReader()
      .withDefaultValue("admin")
      .read("Username");
  String password = textIO.newStringInputReader()
      .withMinLength(6)
      .withInputMasking(true)
      .read("Password");
  int age = textIO.newIntInputReader()
      .withMinVal(13)
      .read("Age");
  Month month = textIO.newEnumInputReader(Month.class)
      .read("What month were you born in?");
  terminal.printf("\nUser %s is %d years old, was born in %s and has the password %s.\n", user, age, month, password);
  textIO.newStringInputReader().withMinLength(0).read("\nPress enter to terminate...");
  textIO.dispose("User '" + user + "' has left the building.");
}
origin: beryx/text-io

String product = textIO.newStringInputReader().read("Product name");
int quantity = textIO.newIntInputReader()
    .withMinVal(1)
    .withMaxVal(10)
org.beryx.textioTextIOnewIntInputReader

Popular methods of TextIO

  • <init>
  • dispose
  • getTextTerminal
  • newBooleanInputReader
  • newDoubleInputReader
  • newGenericInputReader
  • newStringInputReader
  • newEnumInputReader
  • newLongInputReader

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now