congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Quantifier
Code IndexAdd Tabnine to your IDE (free)

How to use
Quantifier
in
juzu.impl.router.regex

Best Java code snippets using juzu.impl.router.regex.Quantifier (Showing top 20 results out of 315)

origin: org.juzu/juzu-core

public static Quantifier zeroOrMore(Mode mode) {
 return new Quantifier(mode, 0, null);
}
origin: org.juzu/juzu-core

public final int getMin() {
 return quantifier == null ? 1 : quantifier.getMin();
}
origin: org.juzu/juzu-core

@Override
public String toString() {
 try {
  StringBuilder sb = new StringBuilder();
  toString(sb);
  return sb.toString();
 }
 catch (IOException e) {
  throw new AssertionError(e);
 }
}
origin: org.juzu/juzu-core

public void testQuantifier() {
 new ParserTester("*").assertParseQuantifier(Quantifier.zeroOrMore(Quantifier.Mode.GREEDY));
 new ParserTester("+").assertParseQuantifier(Quantifier.oneOrMore(Quantifier.Mode.GREEDY));
 new ParserTester("?").assertParseQuantifier(Quantifier.onceOrNotAtAll(Quantifier.Mode.GREEDY));
 new ParserTester("*a").assertParseQuantifier(Quantifier.zeroOrMore(Quantifier.Mode.GREEDY));
 new ParserTester("+a").assertParseQuantifier(Quantifier.oneOrMore(Quantifier.Mode.GREEDY));
 new ParserTester("?a").assertParseQuantifier(Quantifier.onceOrNotAtAll(Quantifier.Mode.GREEDY));
 new ParserTester("*?").assertParseQuantifier(Quantifier.zeroOrMore(Quantifier.Mode.RELUCTANT));
 new ParserTester("+?").assertParseQuantifier(Quantifier.oneOrMore(Quantifier.Mode.RELUCTANT));
 new ParserTester("??").assertParseQuantifier(Quantifier.onceOrNotAtAll(Quantifier.Mode.RELUCTANT));
 new ParserTester("*+").assertParseQuantifier(Quantifier.zeroOrMore(Quantifier.Mode.POSSESSIVE));
 new ParserTester("++").assertParseQuantifier(Quantifier.oneOrMore(Quantifier.Mode.POSSESSIVE));
 new ParserTester("?+").assertParseQuantifier(Quantifier.onceOrNotAtAll(Quantifier.Mode.POSSESSIVE));
 new ParserTester("a").assertParseQuantifier(null);
 new ParserTester("").assertParseQuantifier(null);
 new ParserTester("{2}").assertParseQuantifier(Quantifier.exactly(Quantifier.Mode.GREEDY, 2));
 new ParserTester("{2,}").assertParseQuantifier(Quantifier.atLeast(Quantifier.Mode.GREEDY, 2));
 new ParserTester("{2,4}").assertParseQuantifier(Quantifier.between(Quantifier.Mode.GREEDY, 2, 4));
}
origin: juzu/juzu

public void testQuantifier() {
 new ParserTester("*").assertParseQuantifier(Quantifier.zeroOrMore(Quantifier.Mode.GREEDY));
 new ParserTester("+").assertParseQuantifier(Quantifier.oneOrMore(Quantifier.Mode.GREEDY));
 new ParserTester("?").assertParseQuantifier(Quantifier.onceOrNotAtAll(Quantifier.Mode.GREEDY));
 new ParserTester("*a").assertParseQuantifier(Quantifier.zeroOrMore(Quantifier.Mode.GREEDY));
 new ParserTester("+a").assertParseQuantifier(Quantifier.oneOrMore(Quantifier.Mode.GREEDY));
 new ParserTester("?a").assertParseQuantifier(Quantifier.onceOrNotAtAll(Quantifier.Mode.GREEDY));
 new ParserTester("*?").assertParseQuantifier(Quantifier.zeroOrMore(Quantifier.Mode.RELUCTANT));
 new ParserTester("+?").assertParseQuantifier(Quantifier.oneOrMore(Quantifier.Mode.RELUCTANT));
 new ParserTester("??").assertParseQuantifier(Quantifier.onceOrNotAtAll(Quantifier.Mode.RELUCTANT));
 new ParserTester("*+").assertParseQuantifier(Quantifier.zeroOrMore(Quantifier.Mode.POSSESSIVE));
 new ParserTester("++").assertParseQuantifier(Quantifier.oneOrMore(Quantifier.Mode.POSSESSIVE));
 new ParserTester("?+").assertParseQuantifier(Quantifier.onceOrNotAtAll(Quantifier.Mode.POSSESSIVE));
 new ParserTester("a").assertParseQuantifier(null);
 new ParserTester("").assertParseQuantifier(null);
 new ParserTester("{2}").assertParseQuantifier(Quantifier.exactly(Quantifier.Mode.GREEDY, 2));
 new ParserTester("{2,}").assertParseQuantifier(Quantifier.atLeast(Quantifier.Mode.GREEDY, 2));
 new ParserTester("{2,4}").assertParseQuantifier(Quantifier.between(Quantifier.Mode.GREEDY, 2, 4));
}
origin: juzu/juzu

@Override
public String toString() {
 try {
  StringBuilder sb = new StringBuilder();
  toString(sb);
  return sb.toString();
 }
 catch (IOException e) {
  throw new AssertionError(e);
 }
}
origin: org.juzu/juzu-core

public static Quantifier atLeast(Mode mode, int value) {
 return new Quantifier(mode, value, null);
}
origin: juzu/juzu

public final int getMin() {
 return quantifier == null ? 1 : quantifier.getMin();
}
origin: juzu/juzu

@Override
public final String toString() {
 StringBuilder sb = new StringBuilder();
 if (quantifier != null) {
  String q = quantifier.toString();
  sb.append('<').append(q).append('>');
  writeTo(sb);
  sb.append("</").append(q).append('>');
 }
 else {
  writeTo(sb);
 }
 return sb.toString();
}
origin: org.juzu/juzu-core

public static Quantifier between(Mode mode, int min, int max) {
 return new Quantifier(mode, min, max);
}
origin: org.juzu/juzu-core

@Override
public final String toString() {
 StringBuilder sb = new StringBuilder();
 if (quantifier != null) {
  String q = quantifier.toString();
  sb.append('<').append(q).append('>');
  writeTo(sb);
  sb.append("</").append(q).append('>');
 }
 else {
  writeTo(sb);
 }
 return sb.toString();
}
origin: juzu/juzu

public static Quantifier oneOrMore(Mode mode) {
 return new Quantifier(mode, 1, null);
}
origin: org.juzu/juzu-core

protected void visit(RENode.Assertion.Begin expr) throws IOException {
 appendable.append('^');
 if (expr.getQuantifier() != null) {
  expr.getQuantifier().toString(appendable);
 }
}
origin: juzu/juzu

public static Quantifier atLeast(Mode mode, int value) {
 return new Quantifier(mode, value, null);
}
origin: juzu/juzu

protected void visit(RENode.Any expr) throws IOException {
 appendable.append('.');
 if (expr.getQuantifier() != null) {
  expr.getQuantifier().toString(appendable);
 }
}
origin: juzu/juzu

public static Quantifier exactly(Mode mode, int value) {
 return new Quantifier(mode, value, value);
}
origin: juzu/juzu

protected void visit(RENode.Assertion.Begin expr) throws IOException {
 appendable.append('^');
 if (expr.getQuantifier() != null) {
  expr.getQuantifier().toString(appendable);
 }
}
origin: juzu/juzu

public static Quantifier between(Mode mode, int min, int max) {
 return new Quantifier(mode, min, max);
}
origin: juzu/juzu

protected void visit(RENode.Assertion.End expr) throws IOException {
 appendable.append('$');
 if (expr.getQuantifier() != null) {
  expr.getQuantifier().toString(appendable);
 }
}
origin: org.juzu/juzu-core

public static Quantifier onceOrNotAtAll(Mode mode) {
 return new Quantifier(mode, 0, 1);
}
juzu.impl.router.regexQuantifier

Most used methods

  • <init>
  • atLeast
  • between
  • exactly
  • getMin
  • onceOrNotAtAll
  • oneOrMore
  • toString
  • zeroOrMore

Popular in Java

  • Reading from database using SQL prepared statement
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • getApplicationContext (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • String (java.lang)
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now