A healthy splash of google-collections

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@822 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Dave Hoover
2009-05-23 01:31:14 +00:00
parent a20117d922
commit d2b9e2ebb9
52 changed files with 246 additions and 191 deletions
@@ -28,6 +28,8 @@ import java.util.TreeSet;
import java.awt.Point;
import com.google.common.collect.Lists;
import com.samskivert.util.HashIntMap;
/**
@@ -270,7 +272,7 @@ public class AStarPathUtil
protected static List<Point> getNodePath (Node n)
{
Node cur = n;
ArrayList<Point> path = new ArrayList<Point>();
ArrayList<Point> path = Lists.newArrayList();
while (cur != null) {
// add to the head of the list since we're traversing from
@@ -337,7 +339,7 @@ public class AStarPathUtil
// construct the open and closed lists
open = new TreeSet<Node>();
closed = new ArrayList<Node>();
closed = Lists.newArrayList();
}
/**
@@ -29,6 +29,8 @@ import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Point;
import com.google.common.collect.Lists;
import com.samskivert.util.StringUtil;
import com.threerings.util.DirectionCodes;
@@ -237,7 +239,7 @@ public class LineSegmentPath
if (ox != nx || oy != ny) {
pable.setLocation(nx, ny);
return true;
}
}
return false;
}
@@ -340,7 +342,7 @@ public class LineSegmentPath
addNode(p.x, p.y, dir);
last = p;
}
}
}
/**
* Gets the next node in the path.
@@ -348,10 +350,10 @@ public class LineSegmentPath
protected PathNode getNextNode ()
{
return _niter.next();
}
}
/** The nodes that make up the path. */
protected ArrayList<PathNode> _nodes = new ArrayList<PathNode>();
protected ArrayList<PathNode> _nodes = Lists.newArrayList();
/** We use this when moving along this path. */
protected Iterator<PathNode> _niter;
@@ -371,7 +373,7 @@ public class LineSegmentPath
/** The path velocity in pixels per millisecond. */
protected float _vel = DEFAULT_VELOCITY;
/** When moving, the pathable position including fractional pixels. */
/** When moving, the pathable position including fractional pixels. */
protected float _movex, _movey;
/** When moving, the distance to move on each axis per tick. */
@@ -35,8 +35,7 @@ public class PathSequence
implements Path
{
/**
* Conveniently construct a path sequence with the two specified
* paths.
* Conveniently construct a path sequence with the two specified paths.
*/
public PathSequence (Path first, Path second)
{
@@ -21,7 +21,6 @@
package com.threerings.media.util;
import java.util.HashMap;
import java.util.Map;
import com.google.common.collect.Maps;
@@ -64,7 +63,7 @@ public class PerformanceMonitor
Map<String, PerformanceAction> actions = _observers.get(obs);
if (actions == null) {
// create it if it didn't exist
_observers.put(obs, actions = new HashMap<String, PerformanceAction>());
_observers.put(obs, actions = Maps.newHashMap());
}
// add the action to the set we're tracking
@@ -147,7 +146,7 @@ public class PerformanceMonitor
}
/** The observers monitoring some set of actions. */
protected static Map<PerformanceObserver, Map<String, PerformanceAction>> _observers =
protected static Map<PerformanceObserver, Map<String, PerformanceAction>> _observers =
Maps.newHashMap();
/** Used to obtain high resolution time stamps. */
@@ -207,7 +206,7 @@ class PerformanceAction
/** The number of milliseconds between each checkpoint. */
protected long _delta;
/** The time the last time a checkpoint was made. */
/** The time the last time a checkpoint was made. */
protected long _lastDelta;
/** The number of ticks since the last checkpoint. */