• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TLongObjectHashMap类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中gnu.trove.TLongObjectHashMap的典型用法代码示例。如果您正苦于以下问题:Java TLongObjectHashMap类的具体用法?Java TLongObjectHashMap怎么用?Java TLongObjectHashMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TLongObjectHashMap类属于gnu.trove包,在下文中一共展示了TLongObjectHashMap类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getUpdatedMarkers

import gnu.trove.TLongObjectHashMap; //导入依赖的package包/类
private TLongObjectHashMap<ManualRangeMarker> getUpdatedMarkers(@NotNull FrozenDocument frozen, @NotNull List<DocumentEvent> events) {
  int eventCount = events.size();
  assert eventCount > 0;

  Trinity<Integer, TLongObjectHashMap<ManualRangeMarker>, FrozenDocument> cache = myUpdatedRanges;
  if (cache != null && cache.first.intValue() == eventCount) return cache.second;

  //noinspection SynchronizeOnThis
  synchronized (this) {
    cache = myUpdatedRanges;
    if (cache != null && cache.first.intValue() == eventCount) return cache.second;

    TLongObjectHashMap<ManualRangeMarker> answer;
    if (cache != null && cache.first < eventCount) {
      // apply only the new events
      answer = cache.second.clone();
      frozen = applyEvents(cache.third, events.subList(cache.first, eventCount), answer);
    }
    else {
      List<SelfElementInfo> infos = getInfos();
      answer = new TLongObjectHashMap<ManualRangeMarker>(infos.size());
      for (SelfElementInfo info : infos) {
        ProperTextRange range = info.getPsiRange();
        long key = info.markerCacheKey();
        if (range != null && key != 0) {
          boolean forInjected = info.isForInjected();
          answer.put(key, new ManualRangeMarker(frozen, range, forInjected, forInjected, !forInjected));
        }
      }
      frozen = applyEvents(frozen, events, answer);
    }

    myUpdatedRanges = Trinity.create(eventCount, answer, frozen);
    return answer;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:MarkerCache.java


示例2: updateMarkers

import gnu.trove.TLongObjectHashMap; //导入依赖的package包/类
synchronized void updateMarkers(@NotNull FrozenDocument frozen, @NotNull List<DocumentEvent> events) {
  TLongObjectHashMap<ManualRangeMarker> updated = getUpdatedMarkers(frozen, events);

  for (SelfElementInfo info : getInfos()) {
    long key = info.markerCacheKey();
    if (key != 0) {
      ManualRangeMarker newRangeMarker = updated.get(key);
      info.setRange(newRangeMarker == null ? null : newRangeMarker.getRange());
    }
  }

  myUpdatedRanges = null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:MarkerCache.java


示例3: Multiplexer

import gnu.trove.TLongObjectHashMap; //导入依赖的package包/类
public Multiplexer(@NotNull InputStream in, @NotNull OutputStream out, int mtu,
                   @NotNull ExecutorService executorService,
                   @Nullable NewChannelListener newChannelListener) {
  mDecoder = new Decoder(in);
  mEncoder = new Encoder(out);
  mNewChannelListener = newChannelListener;
  mChannelEventHandler = new ChannelEventHandler();
  mSender = new Sender(mtu, executorService);
  mChannelMap = new TLongObjectHashMap<Channel>();
  mNextChannelId = new AtomicLong(0);
  executorService.execute(new Receiver());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:Multiplexer.java


示例4: clone

import gnu.trove.TLongObjectHashMap; //导入依赖的package包/类
/**
 * Clones the underlying trove collection and returns the clone wrapped in a new
 * decorator instance.  This is a shallow clone except where primitives are
 * concerned.
 *
 * @return a copy of the receiver
 */
public TLongObjectHashMapDecorator clone() {
    try {
        TLongObjectHashMapDecorator copy = (TLongObjectHashMapDecorator) super.clone();
        copy._map = (TLongObjectHashMap)_map.clone();
        return copy;
    } catch (CloneNotSupportedException e) {
        // assert(false);
        throw new InternalError(); // we are cloneable, so this does not happen
    }
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:18,代码来源:TLongObjectHashMapDecorator.java


示例5: readExternal

import gnu.trove.TLongObjectHashMap; //导入依赖的package包/类
public void readExternal(ObjectInput in)
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // MAP
    _map = (TLongObjectHashMap<V>) in.readObject();
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:10,代码来源:TLongObjectHashMapDecorator.java


示例6: MemoryStringPoolImpl

import gnu.trove.TLongObjectHashMap; //导入依赖的package包/类
/**
 * Create a new in memory string pool with 10 items by default.
 */
public MemoryStringPoolImpl() {

  nodeToStringPool = new TLongObjectHashMap<SPObject>(10);
  stringToNodePool = new TObjectLongHashMap<SPObject>(10);
  stringIndex = new TreeSet<SPObject>();

  // intialise the SPObject arrays
  smallestSPObjects = new SPObject[SPObject.TypeCategory.TCID_TYPED_LITERAL + 1];
  largestSPObjects = new SPObject[SPObject.TypeCategory.TCID_TYPED_LITERAL + 1];
  for (int s = 1; s <= SPObject.TypeCategory.TCID_TYPED_LITERAL; s++) {
    smallestSPObjects[s] = new SPLimit(s, true);
    largestSPObjects[s] = new SPLimit(s, false);
  }
}
 
开发者ID:quoll,项目名称:mulgara,代码行数:18,代码来源:MemoryStringPoolImpl.java


示例7: ViewResolver

import gnu.trove.TLongObjectHashMap; //导入依赖的package包/类
/**
 * Construct a resolver.
 *
 * @param resolverSession  the session this resolver is associated with,
 *   never <code>null</code>
 * @param rdfType  the local node representing the <code>rdf:type</code>
 *   property
 * @param modelTypeURI  the local node representing the model type managed
 *   by this class, never {@link NodePool#NONE}
 * @throws IllegalArgumentException  {@inheritDoc}, or if <var>modelType</var>
 *   is {@link NodePool#NONE}
 */
ViewResolver(ResolverSession resolverSession, Resolver systemResolver, long rdfType, long systemModel,
    long systemModelType, URI modelTypeURI, long viewNode,
    long typeNode, long exprNode, long modelNode, long unionNode, long intersectNode)
    throws ResolverFactoryException {

  // Validate "modelType" parameter
  if (modelTypeURI == null) {
    throw new IllegalArgumentException("Graph type can't be null");
  }
  this.resolverSession = resolverSession;
  this.systemResolver = systemResolver;
  this.modelTypeURI = modelTypeURI;
  this.viewNode = viewNode;
  this.typeNode = typeNode;
  this.exprNode = exprNode;
  this.modelNode = modelNode;
  this.unionNode = unionNode;
  this.intersectNode = intersectNode;
  this.viewCache = new TLongObjectHashMap<ViewDefinition>();
  try {
    Node systemModelTypeURIRef = resolverSession.globalize(systemModelType);
    if (systemModelTypeURIRef instanceof URIReference) {
      this.systemModelTypeURI = ((URIReference)systemModelTypeURIRef).getURI();
    } else {
      throw new ResolverFactoryException("systemModelType not a URIRef " + systemModelTypeURIRef);
    }
  } catch (GlobalizeException eg) {
    throw new ResolverFactoryException("Failed to globalize SystemModel Type", eg);
  }
}
 
开发者ID:quoll,项目名称:mulgara,代码行数:43,代码来源:ViewResolver.java


示例8: TLongObjectHashMapDecorator

import gnu.trove.TLongObjectHashMap; //导入依赖的package包/类
/**
 * Creates a wrapper that decorates the specified primitive map.
 */
public TLongObjectHashMapDecorator(TLongObjectHashMap<V> map) {
    super();
    this._map = map;
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:8,代码来源:TLongObjectHashMapDecorator.java


示例9: getMap

import gnu.trove.TLongObjectHashMap; //导入依赖的package包/类
/**
 * Returns a reference to the map wrapped by this decorator.
 */
public TLongObjectHashMap<V> getMap() {
    return _map;
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:7,代码来源:TLongObjectHashMapDecorator.java


示例10: TLongObjectHashMapDecorator

import gnu.trove.TLongObjectHashMap; //导入依赖的package包/类
/**
    * Creates a wrapper that decorates the specified primitive map.
    */
   public TLongObjectHashMapDecorator(TLongObjectHashMap map) {
super();
this._map = map;
   }
 
开发者ID:clulab,项目名称:reach-banner,代码行数:8,代码来源:TLongObjectHashMapDecorator.java


示例11: FileSystemResolver

import gnu.trove.TLongObjectHashMap; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param resolverSession The session in which the resolver exists
 * @param systemResolver The resolver used for the system model
 * @param rdfType The rdf:type predicate
 * @param systemModel The system model node id
 * @param systemModelType The system model's type node id
 * @param modelTypeURI The URI representing the file system's model type
 * @param fileSystemNode The node id for the file system model
 * @param includeNode The inclusion predicate node id
 * @param excludeNode The exclusion predicate node id
 *
 * @throws ResolverFactoryException
 */
FileSystemResolver(ResolverSession resolverSession, Resolver systemResolver,
                   long rdfType, long systemModel, long systemModelType,
                   URI modelTypeURI, long fileSystemNode, long includeNode,
                   long excludeNode) throws ResolverFactoryException {

  // Validate "modelType" parameter
  if (modelTypeURI == null) {

    throw new IllegalArgumentException("Graph type can't be null");
  }

  // Store the global variable values
  this.systemResolver = systemResolver;
  this.modelTypeURI = modelTypeURI;
  this.fileSystemNode = fileSystemNode;
  this.rdfType = rdfType;
  this.includeNode = includeNode;
  this.excludeNode = excludeNode;
  this.systemModel = systemModel;
  this.resolverSession = resolverSession;

  // Initialise the cache
  this.fileSystemCache = new TLongObjectHashMap<Resolution>();

  // Container for our system model's type node
  Node systemModelTypeURIRef = null;

  try {

    // Create an actual node for the system model type
    systemModelTypeURIRef = resolverSession.globalize(systemModelType);
  } catch (GlobalizeException globaliseException) {

    throw new ResolverFactoryException("Failed to globalize SystemModel " +
                                       "Type for file system model",
                                       globaliseException);
  }

  if (systemModelTypeURIRef instanceof URIReference) {

    // If we have a uri reference then store the system type's URI
    this.systemModelTypeURI = ((URIReference) systemModelTypeURIRef).getURI();
  } else {

    // We cannot handle literals for the system model
    throw new ResolverFactoryException("systemModelType not a URIRef " +
                                       systemModelTypeURIRef);
  }

  /**
   * Retrieves a transaction manager to help sequence resolution transactions.
   *
   * @return The transaction manager
   */
}
 
开发者ID:quoll,项目名称:mulgara,代码行数:71,代码来源:FileSystemResolver.java



注:本文中的gnu.trove.TLongObjectHashMap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SQLSelectQuery类代码示例发布时间:2022-05-23
下一篇:
Java Reporter类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap