Addd containsAny method with array paramater.

This commit is contained in:
Christian P. MOMON 2017-04-24 09:44:21 +02:00
parent db6f7bddea
commit e389f37603

46
src/fr/devinsy/util/strings/StringList.java Executable file → Normal file
View file

@ -538,6 +538,52 @@ public class StringList extends ArrayList<String> implements CharSequence
return result; return result;
} }
/**
*
* @param source
* @return
*/
public boolean containsAny(final String... target)
{
boolean result;
if (target == null)
{
result = false;
}
else
{
boolean ended = false;
int index = 0;
result = false;
while (!ended)
{
if (index < target.length)
{
String current = target[index];
if (this.contains(current))
{
ended = true;
result = true;
}
else
{
index += 1;
}
}
else
{
ended = true;
result = false;
}
}
}
//
return result;
}
/** /**
* *
* @return * @return