-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
211 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
triemap/src/main/java/tech/pantheon/triemap/ValuesIterator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2023 PANTHEON.tech, s.r.o. and others. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v1.0 which accompanies this distribution, | ||
* and is available at http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package tech.pantheon.triemap; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
import java.util.Iterator; | ||
|
||
final class ValuesIterator<V> implements Iterator<V> { | ||
private final AbstractIterator<?, V> delegate; | ||
|
||
ValuesIterator(final AbstractIterator<?, V> delegate) { | ||
this.delegate = requireNonNull(delegate); | ||
} | ||
|
||
@Override | ||
public boolean hasNext() { | ||
return delegate.hasNext(); | ||
} | ||
|
||
@Override | ||
public V next() { | ||
return delegate.next().getValue(); | ||
} | ||
|
||
@Override | ||
public void remove() { | ||
delegate.remove(); | ||
} | ||
} |