1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-05 23:22:47 +00:00

Moved packets back to l2jserver2-gameserver-core module

This commit is contained in:
2012-05-03 17:54:04 -03:00
parent df55c684a9
commit 2d80fac50b
172 changed files with 1093 additions and 8892 deletions

View File

@@ -19,6 +19,7 @@ package com.l2jserver.util;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.StringTokenizer;
import com.l2jserver.util.factory.CollectionFactory;
@@ -74,4 +75,20 @@ public class ArrayUtils {
public final static <T> boolean contains(T[] array, T expected) {
return Arrays.binarySearch(array, expected) >= 0;
}
/**
* @param tokenizer
* the tokenizer
* @return an array of strings with each parameter
*/
public static String[] createArgumentArray(StringTokenizer tokenizer) {
if (!tokenizer.hasMoreTokens())
return new String[0];
final String[] args = new String[tokenizer.countTokens()];
int i = 0;
while (tokenizer.hasMoreTokens()) {
args[i++] = tokenizer.nextToken();
}
return args;
}
}