do { myCoord = new Coord(); //********** myCoord.userId = cur.getInt(0); myCoord.timestamp = cur.getLong(1); myCoord.x = cur.getDouble(2); myCoord.y = cur.getDouble(3); myCoord.coordType = cur.getInt(4); myCoord.id = cur.getInt(5); myCoord.coordTypeDesc = cur.getString(6); markerArray.add(myCoord); Log.d("getCoordMarkers()", "X: " + myCoord.x + " Y: " + myCoord.y); myCoord = null; //for the garbage collector ******* } while( cur.moveToNext());
public OrderedSet<K> keysAt(IntVLA positions) { if(keys == null || positions == null || positions.size <= 0) return new OrderedSet<K>(); OrderedSet<K> ks = new OrderedSet<>(positions.size); for(int i = 0; i < positions.size; i++) { ks.add(keyAt(positions.get(i))); } return ks; }
/** * Construct a Spill without a level to actually scan. This constructor allows you to specify an RNG, but the actual * RandomnessSource the RNG that this object uses will not be identical to the one passed as random (two ints will * be requested from the passed RNG, and that will be used to seed this class' RNG). * * If you use this constructor, you must call an initialize() method before using this class. */ public Spill(IRNG random) { rng = new GWTRNG(random.nextInt(), random.nextInt()); fresh = new OrderedSet<>(); }
public OrderedSet<K> keysAt(IntVLA positions) { if(keys == null || positions == null || positions.size <= 0) return new OrderedSet<K>(); OrderedSet<K> ks = new OrderedSet<>(positions.size); for(int i = 0; i < positions.size; i++) { ks.add(keyAt(positions.get(i))); } return ks; }
public OrderedSet<K> keysAt(int... positions) { if(keys == null || positions == null || positions.length <= 0) return new OrderedSet<K>(); OrderedSet<K> ks = new OrderedSet<>(positions.length); for(int i = 0; i < positions.length; i++) { ks.add(keyAt(positions[i])); } return ks; } public OrderedSet<K> keysAt(IntVLA positions)
public OrderedSet<K> keysAt(int... positions) { if(keys == null || positions == null || positions.length <= 0) return new OrderedSet<K>(); OrderedSet<K> ks = new OrderedSet<>(positions.length); for(int i = 0; i < positions.length; i++) { ks.add(keyAt(positions[i])); } return ks; } public OrderedSet<K> keysAt(IntVLA positions)
/** * Constructs a new Thesaurus, seeding its RNG (used to shuffle word order) with the next long from the given RNG. * @param rng an RNG that will only be used to get one long (for seeding this class' RNG) */ public Thesaurus(IRNG rng) { mappings = new OrderedMap<>(256, Hashers.caseInsensitiveStringHasher); this.rng = new GWTRNG(rng.nextLong()); }
/** * Constructs a new Thesaurus, seeding its RNG (used to shuffle word order) with shuffleSeed. * @param shuffleSeed a String for seeding this class' RNG */ public Thesaurus(String shuffleSeed) { mappings = new OrderedMap<>(256, Hashers.caseInsensitiveStringHasher); this.rng = new GWTRNG(CrossHash.hash64(shuffleSeed)); }
/** * Gets the Radiance at the given position, if present, or null if there is no light source there. * @param x the x-position to look up * @param y the y-position to look up * @return the Radiance at the given position, or null if none is present there */ public Radiance get(int x, int y) { return lights.get(Coord.get(x, y)); } /**
/** * Generates a random ordering with rng and applies the same ordering to all kinds of keys this has; they will * maintain their current association to other keys but their ordering/indices will change. * @param rng an IRNG to produce the random ordering this will use * @return this for chaining */ public BundleBundleBiMap<E1, E2> shuffle(IRNG rng) { return reorder(rng.randomOrdering(bm.size())); }
/** * Generates a random ordering with rng and applies the same ordering to all kinds of keys this has; they will * maintain their current association to other keys but their ordering/indices will change. * @param rng an IRNG to produce the random ordering this will use * @return this for chaining */ public BundleBiMap<E, S> shuffle(IRNG rng) { return reorder(rng.randomOrdering(bm.size())); }
/** * Constructs a new Thesaurus with an unseeded RNG used to shuffle word order. */ public Thesaurus() { mappings = new OrderedMap<>(256, Hashers.caseInsensitiveStringHasher); rng = new GWTRNG(); }
@Override public void setRandomness(RandomnessSource random) { super.setRandomness(random == null ? new DiverRNG() : (random instanceof StatefulRandomness) ? random : new DiverRNG(random.nextLong())); }
/** * Get a Set of all identities used for values in this data structure, returning a OrderedSet (defensively * copying the key set used internally) for its stable iteration order. * @return a OrderedSet of I corresponding to the identities present in this data structure. */ public OrderedSet<I> identities() { return new OrderedSet<>(itemMapping.keySet()); }
private static void modifiedShadowFOV(int expansion, int viewerX, int viewerY, Radius metric, ShortSet bounds, ShortSet storedSet, ShortVLA vla) { if(expansion < 1) return; short start = hilbertDistances[viewerX + (viewerY << 8)]; if(storedSet.add(start)) vla.add(start); for (Direction d : Direction.DIAGONALS) { modifiedShadowCast(expansion, 1, 1.0, 0.0, 0, d.deltaX, d.deltaY, 0, viewerX, viewerY, metric, bounds, storedSet, vla); modifiedShadowCast(expansion, 1, 1.0, 0.0, d.deltaX, 0, 0, d.deltaY, viewerX, viewerY, metric, bounds, storedSet, vla); } }
@Override public int hashCode() { int result; long temp; result = from.hashCode(); result = 31 * result + to.hashCode(); temp = NumberTools.doubleToLongBits(cost); result = 31 * result + (int) (temp ^ (temp >>> 32)); return result; }