Java Utililty Methods List Include

List of utility methods to do List Include

Description

The list of methods to do List Include are organized into topic(s).

Method

voidaddToken(String sequence, String delim, int[] markers, boolean includeDelim, List tokens)
add Token
markers[1] = sequence.indexOf(delim, markers[0]);
if (markers[1] < 0)
    markers[1] = sequence.length();
else if (includeDelim)
    markers[1] += delim.length();
tokens.add(sequence.substring(markers[0], markers[1]));
if (includeDelim)
    markers[0] = markers[1];
...
booleancurrentPackageIncludedInExcludePatterns(final String fullyQualifiedName, final List excludePatterns)
current Package Included In Exclude Patterns
if (excludePatterns != null) {
    for (final String excludePattern : excludePatterns) {
        if (fullyQualifiedName.startsWith(excludePattern)) {
            return true;
return false;
...
List>getPrefixesAndSuffixes(List items, int minSize, int maxSize, T paddingSymbol, boolean includePrefixes, boolean includeSuffixes)
Get all prefix/suffix combinations from a list.
assert minSize > 0;
assert maxSize >= minSize;
assert includePrefixes || includeSuffixes;
List<List<T>> prefixesAndSuffixes = new ArrayList<>();
for (int span = minSize - 1; span < maxSize; span++) {
    List<Integer> indices = new ArrayList<>();
    List<T> seq = new ArrayList<>();
    if (includePrefixes) {
...
booleanisAcceptedCountry(String country, List countryInclude, List countryExclude)
Return if a country is accepted
if (country == null || "".equals(country))
    return true;
country = country.toLowerCase();
if (countryInclude != null && countryInclude.size() > 0 && !"".equals(countryInclude.get(0))) {
    if (countryInclude.contains(country))
        return true;
    return false;
if (countryExclude != null && countryExclude.size() > 0 && !"".equals(countryExclude.get(0))) {
    if (countryExclude.contains(country))
        return false;
    return true;
return true;
booleanisIncluded(List list, String src)
Checks if is included.
return isIncluded(list, src, true);
booleanisIndexable(String filename, List includes, List excludes)
We check if we can index the file or if we should ignore it
if (includes.isEmpty() && excludes.isEmpty())
    return true;
for (String exclude : excludes) {
    String regex = exclude.replace("?", ".?").replace("*", ".*?");
    if (filename.matches(regex))
        return false;
if (includes.isEmpty())
...
booleanisIndexable(String key, List includes, List excludes)
Tells if an Aamzon S3 file is indexable from its key (file name), based on includes and excludes rules.
if ((includes == null && excludes == null) || (includes.isEmpty() && excludes.isEmpty())) {
    return true;
if (excludes != null) {
    for (String exclude : excludes) {
        String regex = exclude.replace("?", ".?").replace("*", ".*");
        if (key.matches(regex)) {
            return false;
...