20 package net.sf.gridarta.model.filter;
22 import org.jetbrains.annotations.NotNull;
23 import org.jetbrains.annotations.Nullable;
35 private final StringBuilder
sb =
new StringBuilder();
51 boolean first = !enabled;
53 final boolean inverted =
removePrefix(first ?
"inverted" :
",inverted");
59 while (
sb.length() > 0 &&
sb.charAt(0) !=
')') {
69 if (subFilterConfig ==
null) {
70 throw new NumberFormatException(
"filter has no key '" + key +
"'");
73 throw new NumberFormatException(
"syntax error");
85 boolean first = !enabled;
87 while (
sb.length() > 0 &&
sb.charAt(0) !=
')') {
92 throw new NumberFormatException(
"syntax error");
97 throw new NumberFormatException(
"syntax error");
147 }
catch (
final IndexOutOfBoundsException | NumberFormatException ignored) {
150 return sb.length() == 0;
167 throw new NumberFormatException(
"syntax error");
170 this.filterConfig = prevFilterConfig;
180 final int length =
string.length();
181 if (length >
sb.length() || !
sb.substring(0, length).equals(
string)) {
185 sb.delete(0, length);