Permalink
Browse files

Insert type arguments for Java 1.6

  • Loading branch information...
1 parent 26394f3 commit 97bd648e40b38e83ecaa095e7f84b9567462428d @mikera committed Oct 18, 2012
@@ -74,7 +74,7 @@ public BaseObject(Map<String,Object> data) {
public void replaceWith(BaseObject t) {
if (t.local != null) {
- local = new HashMap<>(t.local);
+ local = new HashMap<String, Object>(t.local);
} else {
local = null;
}
@@ -183,7 +183,7 @@ public final boolean containsLocalKey(String key) {
}
private final void ensureLocal() {
- if (local==null) local=new HashMap<>();
+ if (local==null) local=new HashMap<String, Object>();
}
public final String getString(String s) {
@@ -263,7 +263,7 @@ private Object getUnmodifiedValue(String key) {
* Get a single Map of all property pairs
*/
public Map<String,Object> getAll() {
- Map<String,Object> map = new HashMap<>();
+ Map<String,Object> map = new HashMap<String, Object>();
putAll(map);
return map;
}
@@ -304,7 +304,7 @@ public int getPropertyDepth(String key) {
*/
public static BaseObject getFlattened(BaseObject source) {
BaseObject destination = new BaseObject();
- destination.local=new HashMap<>();
+ destination.local=new HashMap<String, Object>();
source.putAll(destination.local);
return destination;
}
@@ -97,8 +97,8 @@ public static float trace(float x1, float y1, float z1, float x2, float y2, floa
return totalDist;
}
- private ArrayList<int[]> lines=new ArrayList<>();
- private ArrayList<int[]> skips=new ArrayList<>();
+ private ArrayList<int[]> lines=new ArrayList<int[]>();
+ private ArrayList<int[]> skips=new ArrayList<int[]>();
public void initLines(int maxLength) {
lines.clear();
@@ -26,9 +26,9 @@
// priority queue of nodes to search
// sorted by estimated total distance (cost + heuristic)
- protected final RankedQueue<PathNode> nodes=new RankedQueue<>();
- protected final TreeGrid<PathNode> map=new TreeGrid<>();
- protected final ArrayList<PathNode> cache=new ArrayList<>();
+ protected final RankedQueue<PathNode> nodes=new RankedQueue<PathNode>();
+ protected final TreeGrid<PathNode> map=new TreeGrid<PathNode>();
+ protected final ArrayList<PathNode> cache=new ArrayList<PathNode>();
private HeuristicFunction heuristicFunction=null;
private CostFunction costFunction=null;
@@ -146,7 +146,7 @@ public boolean isFound() {
}
public ArrayList<PathNode> getPathNodes() {
- ArrayList<PathNode> al=new ArrayList<>();
+ ArrayList<PathNode> al=new ArrayList<PathNode>();
return getPathNodes(al);
}
@@ -249,7 +249,7 @@ private Object setLocal(int x, int y, int z, T value, int shift) {
} else {
newData[li]=createLocal(x,y,z,value,fill,shift-DIM_SPLIT_BITS);
}
- return new PersistentTreeGrid<> (newData);
+ return new PersistentTreeGrid<T> (newData);
}
private static final Object[] setOrCreateArray(Object[] arr, int pos, Object value) {
@@ -351,7 +351,7 @@ protected Object setBlockLocal(int x1, int y1, int z1, int x2, int y2, int z2, T
} else if (!(d instanceof PersistentTreeGrid<?>)) {
if (d.equals(value)) continue;
PersistentTreeGrid<T> subGrid=(PersistentTreeGrid<T>)
- new PersistentTreeGrid<>((T)d).setBlockLocal(
+ new PersistentTreeGrid<T>((T)d).setBlockLocal(
Maths.max(lx, x1)-lx,
Maths.max(ly, y1)-ly,
Maths.max(lz, z1)-lz,
@@ -390,7 +390,7 @@ protected Object setBlockLocal(int x1, int y1, int z1, int x2, int y2, int z2, T
}
public ArrayList<T> getObjectList(int x1, int y1, int z1, int x2, int y2, int z2) {
- final ArrayList<T> al=new ArrayList<>();
+ final ArrayList<T> al=new ArrayList<T>();
BlockVisitor<T> bv=new BlockVisitor<T>() {
@Override
@@ -59,7 +59,7 @@ public T set(int index, T value) {
}
public SparseArray<T> grow() {
- SparseArray<T> sa=new SparseArray<>(BLOCK_SIZE,shift+BLOCK_BITS);
+ SparseArray<T> sa=new SparseArray<T>(BLOCK_SIZE,shift+BLOCK_BITS);
sa.data[0]=this;
return sa;
}
@@ -83,7 +83,7 @@ public void set(long index, T value) {
private SparseArray<T> growChild(int si, Object d) {
int childShift=Math.max(0, shift-BLOCK_BITS);
- SparseArray<T> child=new SparseArray<>(1<<(shift-childShift), childShift);
+ SparseArray<T> child=new SparseArray<T>(1<<(shift-childShift), childShift);
data[si]=child;
return child;
}
@@ -12,7 +12,7 @@ public SparseGrid() {
@Override
public SparseGrid<T> clear() {
- data=new SparseArray<>();
+ data=new SparseArray<T>();
return this;
}
@@ -215,7 +215,7 @@ public TreeGrid(T defaultvalue) {
return this;
} else if (!(d instanceof TreeGrid<?>)) {
if (d.equals(value)) return this;
- d=new TreeGrid<>((T)d);
+ d=new TreeGrid<T>((T)d);
head.data[li]=d;
}
shift-=DIM_SPLIT_BITS;
@@ -312,7 +312,7 @@ protected Object setBlockLocal(int x1, int y1, int z1, int x2, int y2, int z2, T
d=new TreeGrid<T>();
data[li]=d;
} else if (!(d instanceof TreeGrid<?>)) {
- d=new TreeGrid<>((T)d);
+ d=new TreeGrid<T>((T)d);
data[li]=d;
}
TreeGrid<T> tg=(TreeGrid<T>)d;
@@ -338,7 +338,7 @@ protected Object setBlockLocal(int x1, int y1, int z1, int x2, int y2, int z2, T
}
public ArrayList<T> getObjectList(int x1, int y1, int z1, int x2, int y2, int z2) {
- final ArrayList<T> al=new ArrayList<>();
+ final ArrayList<T> al=new ArrayList<T>();
BlockVisitor<T> bv=new BlockVisitor<T>() {
@Override

0 comments on commit 97bd648

Please sign in to comment.