1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-09 17:02:53 +00:00

First commit

Change-Id: I4d273faba7286288d2b9a214c87c39a76724d787
This commit is contained in:
rogiel
2011-04-28 18:49:39 -03:00
commit 6d52f44278
112 changed files with 1746 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
package com.l2jserver.util;
public class Coordinate {
private final int x;
private final int y;
private final int z;
public Coordinate(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public int getZ() {
return z;
}
public int getDistance(Coordinate other) {
//TODO calculation
return x + y + z;
}
}

View File

@@ -0,0 +1,40 @@
package com.l2jserver.util.factory;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Factory class to create {@link Collection} instances.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public class CollectionFactory {
/**
* Creates a new list of type <tt>T</tt>
*
* @param <T>
* the type
* @param type
* the type
* @return the created list
*/
public static final <T> List<T> newList(Class<T> type) {
return new ArrayList<T>();
}
/**
* Creates a new set of type <tt>T</tt>
*
* @param <T>
* the type
* @param type
* the type
* @return the created set
*/
public static final <T> Set<T> newSet(Class<T> type) {
return new HashSet<T>();
}
}