Refine search
/** {@inheritDoc} */ public TIntList inverseGrep( TIntProcedure condition ) { TIntArrayList list = new TIntArrayList(); for ( int i = 0; i < _pos; i++ ) { if ( !condition.execute( _data[ i ] ) ) { list.add( _data[ i ] ); } } return list; }
SearchRequest<TransportStop> sr = BinaryMapIndexReader.buildSearchTransportRequest(x << pz, (x + 1) << pz, y << pz, (y + 1) << pz, -1, null); TIntArrayList allPoints = new TIntArrayList(); TIntArrayList allPointsLoad = new TIntArrayList(); routes.put(nxt, loadedRoutes.get(nxt)); } else { allPointsLoad.add(nxt);
/** {@inheritDoc} */ public TIntList grep( TIntProcedure condition ) { TIntArrayList list = new TIntArrayList(); for ( int i = 0; i < _pos; i++ ) { if ( condition.execute( _data[ i ] ) ) { list.add( _data[ i ] ); } } return list; }
/** {@inheritDoc} */ public TIntList subList( int begin, int end ) { if ( end < begin ) { throw new IllegalArgumentException( "end index " + end + " greater than begin index " + begin ); } if ( begin < 0 ) { throw new IndexOutOfBoundsException( "begin index can not be < 0" ); } if ( end > _data.length ) { throw new IndexOutOfBoundsException( "end index < " + _data.length ); } TIntArrayList list = new TIntArrayList( end - begin ); for ( int i = begin; i < end; i++ ) { list.add( _data[ i ] ); } return list; }
private static TIntArrayList withPositions(final Vector3i position) { final TIntArrayList positions = new TIntArrayList(); positions.add(position.x); positions.add(position.y); positions.add(position.z); return positions; }
public void feature(){ locationMap = new TreeMap<String, TIntArrayList>(); Set<String> set; featureLen = new int[docs.size()]; for(int i=1;i<docs.size();i++){ set = FingerPrint.featureset(docs.get(i),type); featureLen[i]=set.size(); Object[] sa = set.toArray(); for(int j = 0; j < sa.length; j++) { TIntArrayList al = locationMap.get((String)sa[j]); if(al == null) { al = new TIntArrayList(); al.add(i); locationMap.put((String)sa[j], al); } else al.add(i); } } }
/** * 由上到下存储路径 */ public void CalcPath() { treepath = new int[size][]; for(int i=0;i<size;i++){ TIntArrayList list= new TIntArrayList (); list.add(i); Integer j=i; while((j=edgesInv.get(j))!=null){ list.add(j); } int s = list.size(); treepath[i] = new int[s]; for(int k=0;k<s;k++){ treepath[i][s-k-1] = list.get(k); } } }
public static int[] addFeature(IFeatureAlphabet fa, ArrayList<String> str, int ysize) { TIntArrayList indices = new TIntArrayList(); String constant = "////"; str.add(constant); for(String s: str){ int i = fa.lookupIndex(s,ysize); if(i!=-1) indices.add(i); } return indices.toArray(); }
public void putObjectName(int type, String name){ if(objectNames == null){ objectNames = new TIntObjectHashMap<String>(); namesOrder = new TIntArrayList(); } objectNames.put(type, name); namesOrder.add(type); }
private static TIntArrayList simplify(int[] c, int precision) { int len = c.length / 2; TIntArrayList lt = new TIntArrayList(len * 3); for (int i = 0; i < len; i++) { lt.add(0); lt.add(c[i * 2]); lt.add(c[i * 2 + 1]); } lt.set(0, 1); lt.set((len - 1) * 3, 1); simplifyLine(lt, precision, 0, len - 1); TIntArrayList res = new TIntArrayList(len * 2); for (int i = 0; i < len; i++) { if (lt.get(i * 3) == 1) { res.add(lt.get(i * 3 + 1)); res.add(lt.get(i * 3 + 2)); } } return res; }
private void init(LatLon[] ls) { TIntArrayList px = new TIntArrayList(); TIntArrayList py = new TIntArrayList(); List<Float> speedSegments = new ArrayList<Float>(); for (LatLon s : ls) { float routeSpd = maxSpeed; // (s.getDistance() / s.getRoutingTime()) px.add(MapUtils.get31TileNumberX(s.getLongitude())); py.add(MapUtils.get31TileNumberY(s.getLatitude())); speedSegments.add(routeSpd); } init(px, py, speedSegments); }
if (ind != null) { if (!groupPoints.containsKey(ind)) { groupPoints.put(ind, new TIntArrayList()); groupPoints.get(ind).add(filePointer);
int oldLimit = codedIS.pushLimit(len); while(codedIS.getBytesUntilLimit() > 0) { types.add(codedIS.readRawVarint32()); int pId = codedIS.readRawVarint32(); o.names.put(stag, ((char)pId)+""); list.add(stag); int x = (codedIS.readSInt32() ) + px; int y = (codedIS.readSInt32() ) + py; pointsX.add(x << SHIFT_COORDINATES); pointsY.add(y << SHIFT_COORDINATES); px = x; py = y; globalpointNames.set(pointInd, pointTypes); globalpointNames.get(pointInd).add(pointNameType); globalpointNames.get(pointInd).add(nameInd); int oldLimits = codedIS.pushLimit(lens); while (codedIS.getBytesUntilLimit() > 0) { pointTypes.add(codedIS.readRawVarint32());
continue; String[] toks = line.split("\\s+"); TIntArrayList wordlist = new TIntArrayList(); for(int j=0;j<toks.length;j++){ String tok = toks[j]; continue; int idx = dict.lookupIndex(tok); wordlist.add(idx);
private void init(List<RouteSegmentResult> ls) { TIntArrayList px = new TIntArrayList(); TIntArrayList py = new TIntArrayList(); List<Float> speedSegments = new ArrayList<Float>(); for (RouteSegmentResult s : ls) { boolean plus = s.getStartPointIndex() < s.getEndPointIndex(); int i = s.getStartPointIndex(); RouteDataObject obj = s.getObject(); float routeSpd = (s.getRoutingTime() == 0 || s.getDistance() == 0) ? maxSpeed : (s.getDistance() / s.getRoutingTime()); while (true) { i = plus? i + 1 : i -1; px.add(obj.getPoint31XTile(i)); py.add(obj.getPoint31YTile(i)); speedSegments.add(routeSpd); if (i == s.getEndPointIndex()) { break; } } } init(px, py, speedSegments); }
int x = (codedIS.readSInt32() << SHIFT_COORDINATES) + px; int y = (codedIS.readSInt32() << SHIFT_COORDINATES) + py; req.cacheCoordinates.add(x); req.cacheCoordinates.add(y); px = x; py = y; innercoordinates = new ArrayList<TIntArrayList>(); TIntArrayList polygon = new TIntArrayList(); innercoordinates.add(polygon); px = tree.left & MASK_TO_READ; int x = (codedIS.readSInt32() << SHIFT_COORDINATES) + px; int y = (codedIS.readSInt32() << SHIFT_COORDINATES) + py; polygon.add(x); polygon.add(y); px = x; py = y; additionalTypes.add(codedIS.readRawVarint32()); req.cacheTypes.add(codedIS.readRawVarint32()); int pId = codedIS.readRawVarint32(); stringNames.put(stag, ((char)pId)+""); stringOrder.add(stag);
return o; Integer r = getRule(tp); if(r != null) { types.add(r); } else { int nid = decodingRules.size() + 1; initMapEncodingRule(tp.additionalAttribute, nid, tp.tag, tp.value); types.add(nid); Integer r = getRule(tp); if(r != null) { additionalTypes.add(r); } else { int nid = decodingRules.size() + 1; initMapEncodingRule(tp.additionalAttribute, nid, tp.tag, tp.value); additionalTypes.add(nid); Integer r = getRule(tp); if(r != null) { bm.namesOrder.add(r); bm.objectNames.put(r, name); } else { int nid = decodingRules.size() + 1; initMapEncodingRule(tp.additionalAttribute, nid, tp.tag, tp.value); additionalTypes.add(nid); bm.objectNames.put(nid, name);
TIntArrayList laneTurns = new TIntArrayList(); laneTurns.add(TurnType.getPrimaryTurn(oLanes[i])); if (TurnType.getSecondaryTurn(oLanes[i]) != 0) { laneTurns.add(TurnType.getSecondaryTurn(oLanes[i])); laneTurns.add(TurnType.getTertiaryTurn(oLanes[i]));
&& prevSegm.getDistance() < 100) { int[] lns = prevSegm.getTurnType().getLanes(); TIntArrayList lst = new TIntArrayList(); for(int i = 0; i < lns.length; i++) { if(lns[i] % 2 == 1) { lst.add((lns[i] >> 1) << 1);
public IBlockState getStoneToPut(BlockPos coords) { Set<Type> types = BiomeDictionary.getTypes(supertile.getWorld().getBiome(coords)); TIntArrayList values = new TIntArrayList(); for(int i = 0; i < TYPES.length; i++) { int times = 1; if(types.contains(TYPES[i])) times = 12; for(int j = 0; j < times; j++) values.add(i); } int meta = values.get(supertile.getWorld().rand.nextInt(values.size())); BiomeStoneVariant variant = BiomeStoneVariant.values()[meta]; return ModFluffBlocks.biomeStoneA.getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, variant); }