本文整理汇总了Java中org.oscim.utils.pool.Inlist.push方法的典型用法代码示例。如果您正苦于以下问题:Java Inlist.push方法的具体用法?Java Inlist.push怎么用?Java Inlist.push使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.oscim.utils.pool.Inlist
的用法示例。
在下文中一共展示了Inlist.push方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get
import org.oscim.utils.pool.Inlist; //导入方法依赖的package包/类
public BufferItem get(int size) {
BufferItem b = mPool;
if (b == null) {
b = new BufferItem();
} else {
mPool = b.next;
b.next = null;
}
if (b.size < size)
b.growBuffer(size);
mUsedBuffers = Inlist.push(mUsedBuffers, b);
return b;
}
示例2: put
import org.oscim.utils.pool.Inlist; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public K put(K key, boolean replace) {
if (key.next != null)
throw new IllegalStateException("item not unhooked");
int hash = secondaryHash(key.hashCode());
HashItem[] tab = table;
int index = hash & (tab.length - 1);
for (HashItem e = tab[index]; e != null; e = e.next) {
if (e.hash == hash && key.equals(e)) {
if (replace) {
tab[index] = Inlist.remove(tab[index], e);
tab[index] = Inlist.push(tab[index], key);
}
//V oldValue = e.value;
//e.value = value;
return (K) e; //oldValue;
}
}
// No entry key is present; create one
if (size++ > threshold) {
tab = doubleCapacity();
index = hash & (tab.length - 1);
}
addNewEntry(key, hash, index);
return null;
}
示例3: init
import org.oscim.utils.pool.Inlist; //导入方法依赖的package包/类
@Override
public void init(int num) {
int[] textureIds = new int[num];
GLES20.glGenTextures(num, textureIds, 0);
for (int i = 0; i < num; i++) {
initTexture(textureIds[i]);
TextureItem to = new TextureItem(textureIds[i]);
pool = Inlist.push(pool, to);
}
count = num;
fill = num;
}
示例4: renderPointOfInterestSymbol
import org.oscim.utils.pool.Inlist; //导入方法依赖的package包/类
@Override
public void renderPointOfInterestSymbol(Symbol symbol) {
if (symbol.texture == null){
Log.d(TAG, "missing symbol for " + mElement.tags.asString());
return;
}
SymbolItem it = SymbolItem.pool.get();
it.x = mElement.points[0];
it.y = mElement.points[1];
it.symbol = symbol.texture;
it.billboard = true;
mTile.symbols = Inlist.push(mTile.symbols, it);
}
示例5: process
import org.oscim.utils.pool.Inlist; //导入方法依赖的package包/类
/**
* TileLoaderThemeHook
*/
@Override
public boolean process(MapTile tile, RenderBuckets buckets, MapElement el,
RenderStyle style, int level) {
if (!(style instanceof ExtrusionStyle))
return false;
ExtrusionStyle extrusion = (ExtrusionStyle) style;
ExtendedMapElement element = (ExtendedMapElement) el;
int height = element.buildingHeight > 0 ? element.buildingHeight : 12 * 100; // 12m default
int minHeight = element.buildingMinHeight;
float[] colors = extrusion.colors;
if (element.buildingColor != 0 || element.roofColor != 0) {
// As defined in style
float alpha = 0.9f;
colors = new float[16];
System.arraycopy(extrusion.colors, 0, colors, 0, colors.length);
if (element.roofColor != 0) {
colors[0] = alpha * Color.rToFloat(element.roofColor);
colors[1] = alpha * Color.gToFloat(element.roofColor);
colors[2] = alpha * Color.bToFloat(element.roofColor);
colors[3] = alpha;
}
if (element.buildingColor != 0) {
colors[4] = alpha * Color.rToFloat(element.buildingColor);
colors[5] = alpha * Color.gToFloat(element.buildingColor);
colors[6] = alpha * Color.bToFloat(element.buildingColor);
colors[7] = alpha;
colors[8] = alpha * Color.rToFloat(element.buildingColor);
colors[9] = alpha * Color.gToFloat(element.buildingColor);
colors[10] = alpha * Color.bToFloat(element.buildingColor);
colors[11] = alpha;
}
}
ExtrusionBuckets ebs = get(tile);
for (ExtrusionBucket b = ebs.buckets; b != null; b = b.next()) {
if (b.colors == colors) {
b.add(element, height, minHeight);
return true;
}
}
double lat = MercatorProjection.toLatitude(tile.y);
float groundScale = (float) MercatorProjection.groundResolutionWithScale(lat, 1 << tile.zoomLevel);
ebs.buckets = Inlist.push(ebs.buckets, new ExtrusionBucket(0, groundScale, colors));
ebs.buckets.add(element, height, minHeight);
return true;
}
示例6: render
import org.oscim.utils.pool.Inlist; //导入方法依赖的package包/类
/** TileLoaderThemeHook */
@Override
public boolean render(MapTile tile, RenderBuckets buckets, MapElement element,
RenderStyle style, int level) {
if (!(style instanceof ExtrusionStyle))
return false;
ExtrusionStyle extrusion = (ExtrusionStyle) style;
int height = 0;
int minHeight = 0;
String v = element.tags.getValue(Tag.KEY_HEIGHT);
if (v != null)
height = Integer.parseInt(v);
v = element.tags.getValue(Tag.KEY_MIN_HEIGHT);
if (v != null)
minHeight = Integer.parseInt(v);
/* 12m default */
if (height == 0)
height = 12 * 100;
ExtrusionBuckets ebs = get(tile);
for (ExtrusionBucket b = ebs.buckets; b != null; b = b.next()) {
if (b.colors == extrusion.colors) {
b.add(element, height, minHeight);
return true;
}
}
double lat = MercatorProjection.toLatitude(tile.y);
float groundScale = (float) MercatorProjection
.groundResolution(lat, 1 << tile.zoomLevel);
ebs.buckets = Inlist.push(ebs.buckets,
new ExtrusionBucket(0, groundScale,
extrusion.colors));
ebs.buckets.add(element, height, minHeight);
return true;
}