Class SimpleTextParser.StringCollector
- java.lang.Object
-
- org.apache.commons.geometry.io.core.internal.SimpleTextParser.StringCollector
-
- All Implemented Interfaces:
java.util.function.IntConsumer,java.util.function.IntPredicate
- Enclosing class:
- SimpleTextParser
private final class SimpleTextParser.StringCollector extends java.lang.Object implements java.util.function.IntPredicate, java.util.function.IntConsumerInternal class used to collect strings from the character stream while ensuring that the collected strings do not exceed the maximum configured string length.
-
-
Constructor Summary
Constructors Constructor Description StringCollector(int line, int col, java.util.function.IntPredicate pred)Construct a new instance with the given start position and character predicate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(int value)java.lang.StringgetString()Get the string collected by this instance.private booleanhasExceededMaxStringLength()Return true if this collector has exceeded the maximum configured string length.booleantest(int value)
-
-
-
Method Detail
-
test
public boolean test(int value)
- Specified by:
testin interfacejava.util.function.IntPredicate
-
accept
public void accept(int value)
- Specified by:
acceptin interfacejava.util.function.IntConsumer
-
getString
public java.lang.String getString()
Get the string collected by this instance.- Returns:
- the string collected by this instance
- Throws:
java.lang.IllegalStateException- if the string exceeds the maximum configured length
-
hasExceededMaxStringLength
private boolean hasExceededMaxStringLength()
Return true if this collector has exceeded the maximum configured string length.- Returns:
- true if this collector has exceeded the maximum string length
-
-