Removing unused StringUtil.tokenizerAsIterator that was recently added.

This commit is contained in:
Joakim Erdfelt 2022-07-28 20:29:07 -05:00
parent 4491f1b544
commit b3ee3c29d8
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
1 changed files with 0 additions and 33 deletions

View File

@ -17,11 +17,8 @@ import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.StringTokenizer;
import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.IntStream;
@ -984,36 +981,6 @@ public class StringUtil
return csvSplit(s, 1, s.length() - 2);
}
/**
* Present the results of a {@link StringTokenizer} as an {@link Iterator} of type {@link String}
* @param input the StringTokenizer input
* @param delim the StringTokenizer delim
* @return the resulting iterator for the StringTokenizer
* @see StringTokenizer#StringTokenizer(java.lang.String, java.lang.String)
*/
public static Iterator<String> tokenizerAsIterator(String input, String delim)
{
if (isBlank(input))
return Collections.emptyIterator();
return new Iterator<>()
{
StringTokenizer tokenizer = new StringTokenizer(input, delim);
@Override
public boolean hasNext()
{
return tokenizer.hasMoreTokens();
}
@Override
public String next()
{
return tokenizer.nextToken();
}
};
}
/**
* Parse a CSV string using {@link #csvSplit(List, String, int, int)}
*