Skip to content

Commit

Permalink
mP1/walkingkooka-text-cursor-parser#176 ParserToken.removeFirstIf/rem…
Browse files Browse the repository at this point in the history
…oveIf default methods

- mP1/walkingkooka-text-cursor-parser#176
- ParserToken.removeFirstIf/removeIf default methods
  • Loading branch information
mP1 committed Dec 12, 2023
1 parent f1db9b6 commit 8198c55
Show file tree
Hide file tree
Showing 60 changed files with 0 additions and 1,377 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import walkingkooka.text.cursor.parser.ParserToken;

import java.util.Optional;
import java.util.function.Function;
import java.util.function.Predicate;

Expand All @@ -38,28 +37,6 @@ private NodeSelectorAbsoluteParserToken(final String value, final String text) {
super(value, text);
}

// removeFirstIf....................................................................................................

@Override
public Optional<NodeSelectorAbsoluteParserToken> removeFirstIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeFirstIfLeaf(
this,
predicate,
NodeSelectorAbsoluteParserToken.class
);
}

// removeIf..........................................................................................................

@Override
public Optional<NodeSelectorAbsoluteParserToken> removeIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeIfLeaf(
this,
predicate,
NodeSelectorAbsoluteParserToken.class
);
}

// replaceFirstIf...................................................................................................

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import walkingkooka.visit.Visiting;

import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Predicate;

Expand Down Expand Up @@ -51,28 +50,6 @@ public NodeSelectorAdditionParserToken setChildren(final List<ParserToken> child
);
}

// removeFirstIf....................................................................................................

@Override
public Optional<NodeSelectorAdditionParserToken> removeFirstIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeFirstIfParent(
this,
predicate,
NodeSelectorAdditionParserToken.class
);
}

// removeIf.........................................................................................................

@Override
public Optional<NodeSelectorAdditionParserToken> removeIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeIfParent(
this,
predicate,
NodeSelectorAdditionParserToken.class
);
}

// replaceFirstIf...................................................................................................

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import walkingkooka.text.cursor.parser.ParserToken;

import java.util.Optional;
import java.util.function.Function;
import java.util.function.Predicate;

Expand All @@ -38,28 +37,6 @@ private NodeSelectorAncestorOrSelfParserToken(final String value, final String t
super(value, text);
}

// removeFirstIf....................................................................................................

@Override
public Optional<NodeSelectorAncestorOrSelfParserToken> removeFirstIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeFirstIfLeaf(
this,
predicate,
NodeSelectorAncestorOrSelfParserToken.class
);
}

// removeIf.........................................................................................................

@Override
public Optional<NodeSelectorAncestorOrSelfParserToken> removeIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeIfLeaf(
this,
predicate,
NodeSelectorAncestorOrSelfParserToken.class
);
}

// replaceFirstIf...................................................................................................

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import walkingkooka.text.cursor.parser.ParserToken;

import java.util.Optional;
import java.util.function.Function;
import java.util.function.Predicate;

Expand All @@ -37,27 +36,6 @@ static NodeSelectorAncestorParserToken with(final String value, final String tex
private NodeSelectorAncestorParserToken(final String value, final String text) {
super(value, text);
}
// removeFirstIf....................................................................................................

@Override
public Optional<NodeSelectorAncestorParserToken> removeFirstIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeFirstIfLeaf(
this,
predicate,
NodeSelectorAncestorParserToken.class
);
}

// removeIf.........................................................................................................

@Override
public Optional<NodeSelectorAncestorParserToken> removeIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeIfLeaf(
this,
predicate,
NodeSelectorAncestorParserToken.class
);
}

// replaceFirstIf...................................................................................................

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import walkingkooka.visit.Visiting;

import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Predicate;

Expand Down Expand Up @@ -50,28 +49,6 @@ public NodeSelectorAndParserToken setChildren(final List<ParserToken> children)
);
}

// removeFirstIf....................................................................................................

@Override
public Optional<NodeSelectorAndParserToken> removeFirstIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeFirstIfParent(
this,
predicate,
NodeSelectorAndParserToken.class
);
}

// removeIf.........................................................................................................

@Override
public Optional<NodeSelectorAndParserToken> removeIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeIfParent(
this,
predicate,
NodeSelectorAndParserToken.class
);
}

// replaceFirstIf...................................................................................................

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import walkingkooka.text.cursor.parser.ParserToken;

import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Predicate;

Expand Down Expand Up @@ -51,28 +50,6 @@ NodeSelectorBinaryParserToken<?> binaryOperand(final List<ParserToken> tokens, f
return and(tokens, text);
}

// removeFirstIf....................................................................................................

@Override
public Optional<NodeSelectorAndSymbolParserToken> removeFirstIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeFirstIfLeaf(
this,
predicate,
NodeSelectorAndSymbolParserToken.class
);
}

// removeIf.........................................................................................................

@Override
public Optional<NodeSelectorAndSymbolParserToken> removeIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeIfLeaf(
this,
predicate,
NodeSelectorAndSymbolParserToken.class
);
}

// replaceFirstIf...................................................................................................

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import walkingkooka.text.cursor.parser.ParserToken;

import java.util.Optional;
import java.util.function.Function;
import java.util.function.Predicate;

Expand All @@ -38,28 +37,6 @@ private NodeSelectorAtSignSymbolParserToken(final String value, final String tex
super(value, text);
}

// removeFirstIf....................................................................................................

@Override
public Optional<NodeSelectorAtSignSymbolParserToken> removeFirstIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeFirstIfLeaf(
this,
predicate,
NodeSelectorAtSignSymbolParserToken.class
);
}

// removeIf.........................................................................................................

@Override
public Optional<NodeSelectorAtSignSymbolParserToken> removeIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeIfLeaf(
this,
predicate,
NodeSelectorAtSignSymbolParserToken.class
);
}

// replaceFirstIf...................................................................................................

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import walkingkooka.text.cursor.parser.ParserToken;

import java.util.Optional;
import java.util.function.Function;
import java.util.function.Predicate;

Expand All @@ -38,28 +37,6 @@ private NodeSelectorAttributeNameParserToken(final NodeSelectorAttributeName val
super(value, text);
}

// removeFirstIf....................................................................................................

@Override
public Optional<NodeSelectorAttributeNameParserToken> removeFirstIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeFirstIfLeaf(
this,
predicate,
NodeSelectorAttributeNameParserToken.class
);
}

// removeIf..........................................................................................................

@Override
public Optional<NodeSelectorAttributeNameParserToken> removeIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeIfLeaf(
this,
predicate,
NodeSelectorAttributeNameParserToken.class
);
}

// replaceFirstIf...................................................................................................

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import walkingkooka.visit.Visiting;

import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Predicate;

Expand Down Expand Up @@ -67,28 +66,6 @@ public NodeSelectorAttributeParserToken setChildren(final List<ParserToken> chil
);
}

// removeFirstIf....................................................................................................

@Override
public Optional<NodeSelectorAttributeParserToken> removeFirstIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeFirstIfParent(
this,
predicate,
NodeSelectorAttributeParserToken.class
);
}

// removeIf.........................................................................................................

@Override
public Optional<NodeSelectorAttributeParserToken> removeIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeIfParent(
this,
predicate,
NodeSelectorAttributeParserToken.class
);
}

// replaceFirstIf...................................................................................................

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import walkingkooka.text.cursor.parser.ParserToken;

import java.util.Optional;
import java.util.function.Function;
import java.util.function.Predicate;

Expand All @@ -38,28 +37,6 @@ private NodeSelectorBracketCloseSymbolParserToken(final String value, final Stri
super(value, text);
}

// removeFirstIf....................................................................................................

@Override
public Optional<NodeSelectorBracketCloseSymbolParserToken> removeFirstIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeFirstIfLeaf(
this,
predicate,
NodeSelectorBracketCloseSymbolParserToken.class
);
}

// removeIf.........................................................................................................

@Override
public Optional<NodeSelectorBracketCloseSymbolParserToken> removeIf(final Predicate<ParserToken> predicate) {
return ParserToken.removeIfLeaf(
this,
predicate,
NodeSelectorBracketCloseSymbolParserToken.class
);
}

// replaceFirstIf...................................................................................................

@Override
Expand Down
Loading

0 comments on commit 8198c55

Please sign in to comment.