mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-08-30 09:09:32 +02:00
Add method for Collection.
This commit is contained in:
parent
af5e38b0a8
commit
dcb48c8800
|
@ -109,7 +109,7 @@ public class CharPrefixTree<N extends CharNode<N>, L extends CharLookupEntry<N>>
|
||||||
/**
|
/**
|
||||||
* Test hasPrefixWords for each given argument.
|
* Test hasPrefixWords for each given argument.
|
||||||
* @param inputs
|
* @param inputs
|
||||||
* @return true if hasPrefixWords returns ture for any of the inputs, false otherwise.
|
* @return true if hasPrefixWords(String) returns true for any of the inputs, false otherwise.
|
||||||
*/
|
*/
|
||||||
public boolean hasAnyPrefixWords(final String... inputs){
|
public boolean hasAnyPrefixWords(final String... inputs){
|
||||||
for (int i = 0; i < inputs.length; i++){
|
for (int i = 0; i < inputs.length; i++){
|
||||||
|
@ -120,6 +120,20 @@ public class CharPrefixTree<N extends CharNode<N>, L extends CharLookupEntry<N>>
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test hasPrefixWords for each element of the collection.
|
||||||
|
* @param inputs
|
||||||
|
* @return true if hasPrefixWords(String) returns true for any of the elements, false otherwise.
|
||||||
|
*/
|
||||||
|
public boolean hasAnyPrefixWords(final Collection<String> inputs){
|
||||||
|
for (final String input : inputs){
|
||||||
|
if (hasPrefixWords(input)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isPrefix(final char[] chars){
|
public boolean isPrefix(final char[] chars){
|
||||||
return isPrefix(toCharacterList(chars));
|
return isPrefix(toCharacterList(chars));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user