Codota Logo
TLongObjectHashMap.<init>
Code IndexAdd Codota to your IDE (free)

How to use
gnu.trove.map.hash.TLongObjectHashMap
constructor

Best Java code snippets using gnu.trove.map.hash.TLongObjectHashMap.<init> (Showing top 20 results out of 315)

  • Common ways to obtain TLongObjectHashMap
private void myMethod () {
TLongObjectHashMap t =
  • Codota Iconnew TLongObjectHashMap<>()
  • Smart code suggestions by Codota
}
origin: FudanNLP/fnlp

public SparseMatrixT(){
  vector = new TLongObjectHashMap<T>(100,0.8f);
}

origin: FudanNLP/fnlp

public SparseMatrix(){
  vector = new TLongObjectHashMap<T>(100,0.8f);
}

origin: opentripplanner/OpenTripPlanner

public HashGridSpatialIndex(double xBinSize, double yBinSize) {
  if (xBinSize <= 0 || yBinSize <= 0)
    throw new IllegalStateException("bin size must be positive.");
  this.xBinSize = xBinSize;
  this.yBinSize = yBinSize;
  // For 200m bins, 500x500 = 100x100km = 250000 bins
  bins = new TLongObjectHashMap<>();
}
origin: MovingBlocks/Terasology

public Component put(long entityId, Component component) {
  TLongObjectMap<Component> entityMap = store.get(component.getClass());
  if (entityMap == null) {
    entityMap = new TLongObjectHashMap<>();
    store.put(component.getClass(), entityMap);
  }
  return entityMap.put(entityId, component);
}
origin: FudanNLP/fnlp

public SparseMatrixT<T> clone(){
  SparseMatrixT<T> mat = new SparseMatrixT<T>();
  mat.dim = this.dim;
  mat.vector = new TLongObjectHashMap<T>(vector);
  return mat;
}

origin: osmandapp/Osmand

public void setLoadedNonNative(){
  isLoaded = Math.abs(isLoaded) + 1;
  routes = new TLongObjectHashMap<BinaryRoutePlanner.RouteSegment>();
  tileStatistics = new TileStatistics();
}

origin: osmandapp/Osmand

public List<RouteDataObject> loadRouteRegionData(RouteSubregion rs) throws IOException {
  TLongArrayList idMap = new TLongArrayList();
  TLongObjectHashMap<RestrictionInfo> restrictionMap = new TLongObjectHashMap<RestrictionInfo>();
  if (rs.dataObjects == null) {
    codedIS.seek(rs.filePointer + rs.shiftToData);
    int limit = codedIS.readRawVarint32();
    int oldLimit = codedIS.pushLimit(limit);
    readRouteTreeData(rs, idMap, restrictionMap);
    codedIS.popLimit(oldLimit);
  }
  List<RouteDataObject> res = rs.dataObjects;
  rs.dataObjects = null;
  return res;
}

origin: osmandapp/Osmand

public TransportRoutingContext(TransportRoutingConfiguration cfg, BinaryMapIndexReader... readers) {
  this.cfg = cfg;
  walkRadiusIn31 = (int) (cfg.walkRadius / MapUtils.getTileDistanceWidth(31));
  walkChangeRadiusIn31 = (int) (cfg.walkChangeRadius / MapUtils.getTileDistanceWidth(31));
  quadTree = new TLongObjectHashMap<List<TransportRouteSegment>>();
  for (BinaryMapIndexReader r : readers) {
    routeMap.put(r, new TIntObjectHashMap<TransportRoute>());
  }
}

origin: osmandapp/Osmand

  public void setLoadedNative(NativeRouteSearchResult r, RoutingContext ctx) {
    isLoaded = Math.abs(isLoaded) + 1;
    tileStatistics = new TileStatistics();
    if (r.objects != null) {
      searchResult = null;
      routes = new TLongObjectHashMap<BinaryRoutePlanner.RouteSegment>();
      for (RouteDataObject ro : r.objects) {
        if (ro != null && ctx.config.router.acceptLine(ro)) {
          add(ro);
        }
      }
    } else {
      searchResult = r;
      tileStatistics.size += 100;
    }
  }
}
origin: osmandapp/Osmand

public void loadRouteRegionData(List<RouteSubregion> toLoad, ResultMatcher<RouteDataObject> matcher) throws IOException {
  Collections.sort(toLoad, new Comparator<RouteSubregion>() {
    @Override
    public int compare(RouteSubregion o1, RouteSubregion o2) {
      int p1 = o1.filePointer + o1.shiftToData;
      int p2 = o2.filePointer + o2.shiftToData;
      return p1 == p2 ? 0 : (p1 < p2 ? -1 : 1);
    }
  });
  TLongArrayList idMap = new TLongArrayList();
  TLongObjectHashMap<RestrictionInfo> restrictionMap = new TLongObjectHashMap<RestrictionInfo>();
  for (RouteSubregion rs : toLoad) {
    if (rs.dataObjects == null) {
      codedIS.seek(rs.filePointer + rs.shiftToData);
      int limit = codedIS.readRawVarint32();
      int oldLimit = codedIS.pushLimit(limit);
      readRouteTreeData(rs, idMap, restrictionMap);
      codedIS.popLimit(oldLimit);
    }
    for (RouteDataObject ro : rs.dataObjects) {
      if (ro != null) {
        matcher.publish(ro);
      }
    }
    // free objects
    rs.dataObjects = null;
  }
}
origin: osmandapp/Osmand

SearchRequest<Amenity> request = new SearchRequest<Amenity>();
float coeff = (float) (radius / MapUtils.getTileDistanceWidth(SearchRequest.ZOOM_TO_SEARCH_POI));
TLongObjectHashMap<List<Location>> zooms = new TLongObjectHashMap<List<Location>>();
for (int i = 1; i < route.size(); i++) {
  Location cr = route.get(i);
origin: osmandapp/Osmand

public void loadTileData(int x31, int y31, int zoomAround, final List<RouteDataObject> toFillIn) {
  int t =  config.ZOOM_TO_LOAD_TILES - zoomAround;
  int coordinatesShift = (1 << (31 - config.ZOOM_TO_LOAD_TILES));
  if(t <= 0) {
    t = 1;
    coordinatesShift = (1 << (31 - zoomAround));
  } else {
    t = 1 << t;
  }
  
  TLongHashSet ts = new TLongHashSet(); 
  long now = System.nanoTime();
  for(int i = -t; i <= t; i++) {
    for(int j = -t; j <= t; j++) {
      ts.add(getRoutingTile(x31 +i*coordinatesShift, y31 + j*coordinatesShift, 0, OPTION_IN_MEMORY_LOAD));		
    }
  }
  TLongIterator it = ts.iterator();
  TLongObjectHashMap<RouteDataObject> excludeDuplications = new TLongObjectHashMap<RouteDataObject>();
  while(it.hasNext()){
    getAllObjects(it.next(), toFillIn, excludeDuplications);
  }
  timeToFindInitialSegments += (System.nanoTime() - now);
}

origin: osmandapp/Osmand

TLongObjectHashMap<RouteSegment> visitedDirectSegments = new TLongObjectHashMap<RouteSegment>();
TLongObjectHashMap<RouteSegment> visitedOppositeSegments = new TLongObjectHashMap<RouteSegment>();
origin: DV8FromTheWorld/JDA

/**
 * Constructs an unavailable Widget
 */
private Widget(long guildId)
{
  isAvailable = false;
  id = guildId;
  name = null;
  invite = null;
  channels = new TLongObjectHashMap<>();
  members = new TLongObjectHashMap<>();
}
 
origin: osmandapp/Osmand

List<TransportRouteSegment> endStops = ctx.getTransportStops(end);
TLongObjectHashMap<TransportRouteSegment> endSegments = new TLongObjectHashMap<TransportRouteSegment>();
for(TransportRouteSegment s : endStops) {
  endSegments.put(s.getId(), s);
origin: osmandapp/Osmand

TIntArrayList allPointsLoad = new TIntArrayList();
TLongObjectHashMap<TransportStop> loadedTransportStops = new TLongObjectHashMap<TransportStop>();
for(BinaryMapIndexReader r : routeMap.keySet()) {
  sr.clearSearchResults();
origin: osmandapp/Osmand

public RouteSegment loadRouteSegment(int x31, int y31, int memoryLimit) {
  long tileId = getRoutingTile(x31, y31, memoryLimit, OPTION_SMART_LOAD);
  TLongObjectHashMap<RouteDataObject> excludeDuplications = new TLongObjectHashMap<RouteDataObject>();
  RouteSegment original = null;
  if (tileRoutes.containsKey(tileId)) {
origin: DV8FromTheWorld/JDA

/**
 * Generates a new thread-safe {@link gnu.trove.map.TLongObjectMap TLongObjectMap}
 *
 * @param  <T>
 *         The Object type
 *
 * @return a new thread-safe {@link gnu.trove.map.TLongObjectMap TLongObjectMap}
 */
public static <T> TLongObjectMap<T> newLongMap()
{
  return new TSynchronizedLongObjectMap<>(new TLongObjectHashMap<T>(), new Object());
}
origin: mapsforge/mapsforge

private RAMTileBasedDataProcessor(MapWriterConfiguration configuration) {
  super(configuration);
  this.nodes = new TLongObjectHashMap<>();
  this.ways = new TLongObjectHashMap<>();
  this.multipolygons = new TLongObjectHashMap<>();
  this.tileData = new RAMTileData[this.zoomIntervalConfiguration.getNumberOfZoomIntervals()][][];
  // compute number of tiles needed on each base zoom level
  for (int i = 0; i < this.zoomIntervalConfiguration.getNumberOfZoomIntervals(); i++) {
    this.tileData[i] = new RAMTileData[this.tileGridLayouts[i].getAmountTilesHorizontal()][this.tileGridLayouts[i]
        .getAmountTilesVertical()];
  }
}
origin: DV8FromTheWorld/JDA

public synchronized void cache(Type type, long triggerId, long responseTotal, JSONObject event, CacheConsumer handler)
{
  TLongObjectMap<List<CacheNode>> triggerCache =
      eventCache.computeIfAbsent(type, k -> new TLongObjectHashMap<>());
  List<CacheNode> items = triggerCache.get(triggerId);
  if (items == null)
  {
    items = new LinkedList<>();
    triggerCache.put(triggerId, items);
  }
  items.add(new CacheNode(responseTotal, event, handler));
}
gnu.trove.map.hashTLongObjectHashMap<init>

Javadoc

Creates a new TLongObjectHashMap instance with the default capacity and load factor.

Popular methods of TLongObjectHashMap

  • put
  • get
  • size
  • contains
  • iterator
  • remove
  • containsKey
  • forEachEntry
  • putAll
  • valueCollection
  • clear
  • doPut
  • clear,
  • doPut,
  • forEach,
  • index,
  • postInsertHook,
  • reenableAutoCompaction,
  • removeAt,
  • setUp,
  • tempDisableAutoCompaction

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • orElseThrow (Optional)
  • getExternalFilesDir (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now