热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

net.sf.ehcache.Element.equals()方法的使用及代码示例

本文整理了Java中net.sf.ehcache.Element.equals()方法的一些代码示例,展示了Element.equals()的

本文整理了Java中net.sf.ehcache.Element.equals()方法的一些代码示例,展示了Element.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.equals()方法的具体详情如下:
包路径:net.sf.ehcache.Element
类名称:Element
方法名:equals

Element.equals介绍

[英]Equals comparison with another element, based on the key.
[中]

代码示例

代码示例来源:origin: net.sf.ehcache/ehcache

@Override
public boolean contains(Object o) {
if (!(o instanceof Entry))
return false;
Entry e = (Entry)o;
Element v = SelectableConcurrentHashMap.this.get(e.getKey());
return v != null && v.equals(e.getValue());
}

代码示例来源:origin: net.sf.ehcache/ehcache

/**
* Finds the best eviction candidate based on the sampled elements. What distuingishes this approach
* from the classic data structures approach, is that an Element contains metadata which can be used
* for making policy decisions, while generic data structures do not.
*
* @param sampledElements this should be a random subset of the population
* @param justAdded we never want to select the element just added. May be null.
* @return the least hit
*/
public Element selectedBasedOnPolicy(Element[] sampledElements, Element justAdded) {
//edge condition when Memory Store configured to size 0
if (sampledElements.length == 1) {
return sampledElements[0];
}
Element lowestElement = null;
for (Element element : sampledElements) {
if (element == null) {
continue;
}
if (lowestElement == null) {
if (!element.equals(justAdded)) {
lowestElement = element;
}
} else if (compare(lowestElement, element) && !element.equals(justAdded)) {
lowestElement = element;
}
}
return lowestElement;
}

代码示例来源:origin: net.sf.ehcache/ehcache

/**
* {@inheritDoc}
*/
public boolean equals(Element e1, Element e2) {
if (e1 == null && e2 == null) {
return true;
} else if (e1 != null && e1.equals(e2)) {
if (e1.getObjectValue() == null) {
return e2.getObjectValue() == null;
} else {
return compareValues(e1.getObjectValue(), e2.getObjectValue());
}
} else {
return false;
}
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.0

private static boolean fullElementEquals(Element e1, Element e2) {
if (e1.equals(e2)) {
if (e1.getObjectValue() == null) {
return e2.getObjectValue() == null;
} else {
return e1.getObjectValue().equals(e2.getObjectValue());
}
} else {
return false;
}
}
}

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

@Override
public boolean contains(Object o) {
if (!(o instanceof Entry))
return false;
Entry e = (Entry)o;
Element v = SelectableConcurrentHashMap.this.get(e.getKey());
return v != null && v.equals(e.getValue());
}

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

@Override
public boolean contains(Object o) {
if (!(o instanceof Entry))
return false;
Entry e = (Entry)o;
Element v = SelectableConcurrentHashMap.this.get(e.getKey());
return v != null && v.equals(e.getValue());
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

@Override
public boolean contains(Object o) {
if (!(o instanceof Entry))
return false;
Entry e = (Entry)o;
Element v = SelectableConcurrentHashMap.this.get(e.getKey());
return v != null && v.equals(e.getValue());
}

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

/**
* Finds the best eviction candidate based on the sampled elements. What distuingishes this approach
* from the classic data structures approach, is that an Element contains metadata which can be used
* for making policy decisions, while generic data structures do not.
*
* @param sampledElements this should be a random subset of the population
* @param justAdded we never want to select the element just added. May be null.
* @return the least hit
*/
public Element selectedBasedOnPolicy(Element[] sampledElements, Element justAdded) {
//edge condition when Memory Store configured to size 0
if (sampledElements.length == 1) {
return sampledElements[0];
}
Element lowestElement = null;
for (Element element : sampledElements) {
if (element == null) {
continue;
}
if (lowestElement == null) {
if (!element.equals(justAdded)) {
lowestElement = element;
}
} else if (compare(lowestElement, element) && !element.equals(justAdded)) {
lowestElement = element;
}
}
return lowestElement;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

/**
* Finds the best eviction candidate based on the sampled elements. What distuingishes this approach
* from the classic data structures approach, is that an Element contains metadata which can be used
* for making policy decisions, while generic data structures do not.
*
* @param sampledElements this should be a random subset of the population
* @param justAdded we never want to select the element just added. May be null.
* @return the least hit
*/
public Element selectedBasedOnPolicy(Element[] sampledElements, Element justAdded) {
//edge condition when Memory Store configured to size 0
if (sampledElements.length == 1) {
return sampledElements[0];
}
Element lowestElement = null;
for (Element element : sampledElements) {
if (element == null) {
continue;
}
if (lowestElement == null) {
if (!element.equals(justAdded)) {
lowestElement = element;
}
} else if (compare(lowestElement, element) && !element.equals(justAdded)) {
lowestElement = element;
}
}
return lowestElement;
}

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

/**
* Finds the best eviction candidate based on the sampled elements. What distuingishes this approach
* from the classic data structures approach, is that an Element contains metadata which can be used
* for making policy decisions, while generic data structures do not.
*
* @param sampledElements this should be a random subset of the population
* @param justAdded we never want to select the element just added. May be null.
* @return the least hit
*/
public Element selectedBasedOnPolicy(Element[] sampledElements, Element justAdded) {
//edge condition when Memory Store configured to size 0
if (sampledElements.length == 1) {
return sampledElements[0];
}
Element lowestElement = null;
for (Element element : sampledElements) {
if (element == null) {
continue;
}
if (lowestElement == null) {
if (!element.equals(justAdded)) {
lowestElement = element;
}
} else if (compare(lowestElement, element) && !element.equals(justAdded)) {
lowestElement = element;
}
}
return lowestElement;
}

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

/**
* {@inheritDoc}
*/
public boolean equals(Element e1, Element e2) {
if (e1 == null && e2 == null) {
return true;
} else if (e1 != null && e1.equals(e2)) {
if (e1.getObjectValue() == null) {
return e2.getObjectValue() == null;
} else {
return compareValues(e1.getObjectValue(), e2.getObjectValue());
}
} else {
return false;
}
}

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

/**
* {@inheritDoc}
*/
public boolean equals(Element e1, Element e2) {
if (e1 == null && e2 == null) {
return true;
} else if (e1 != null && e1.equals(e2)) {
if (e1.getObjectValue() == null) {
return e2.getObjectValue() == null;
} else {
return compareValues(e1.getObjectValue(), e2.getObjectValue());
}
} else {
return false;
}
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

/**
* {@inheritDoc}
*/
public boolean equals(Element e1, Element e2) {
if (e1 == null && e2 == null) {
return true;
} else if (e1 != null && e1.equals(e2)) {
if (e1.getObjectValue() == null) {
return e2.getObjectValue() == null;
} else {
return compareValues(copyForReadIfNeeded(e1).getObjectValue(), copyForReadIfNeeded(e2).getObjectValue());
}
} else {
return false;
}
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

boolean containsKey(final Object key, final int hash) {
readLock().lock();
try {
if (count != 0) { // read-volatile
HashEntry e = getFirst(hash);
while (e != null) {
if (e.hash == hash && key.equals(e.key) && !e.value.equals(DUMMY_PINNED_ELEMENT))
return true;
e = e.next;
}
}
return false;
} finally {
readLock().unlock();
}
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

Element get(final Object key, final int hash) {
readLock().lock();
try {
if (count != 0) { // read-volatile
HashEntry e = getFirst(hash);
while (e != null) {
if (e.hash == hash && key.equals(e.key) && !e.value.equals(DUMMY_PINNED_ELEMENT)) {
e.accessed = true;
return e.value;
}
e = e.next;
}
}
return null;
} finally {
readLock().unlock();
}
}

推荐阅读
  • 本文整理了Java中org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc.getTypeInfo()方法的一些代码示例,展 ... [详细]
  • 标题: ... [详细]
  • 本文介绍了RxJava在Android开发中的广泛应用以及其在事件总线(Event Bus)实现中的使用方法。RxJava是一种基于观察者模式的异步java库,可以提高开发效率、降低维护成本。通过RxJava,开发者可以实现事件的异步处理和链式操作。对于已经具备RxJava基础的开发者来说,本文将详细介绍如何利用RxJava实现事件总线,并提供了使用建议。 ... [详细]
  • Iamtryingtocreateanarrayofstructinstanceslikethis:我试图创建一个这样的struct实例数组:letinstallers: ... [详细]
  • 目录实现效果:实现环境实现方法一:基本思路主要代码JavaScript代码总结方法二主要代码总结方法三基本思路主要代码JavaScriptHTML总结实 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • Go GUIlxn/walk 学习3.菜单栏和工具栏的具体实现
    本文介绍了使用Go语言的GUI库lxn/walk实现菜单栏和工具栏的具体方法,包括消息窗口的产生、文件放置动作响应和提示框的应用。部分代码来自上一篇博客和lxn/walk官方示例。文章提供了学习GUI开发的实际案例和代码示例。 ... [详细]
  • 本文讨论了clone的fork与pthread_create创建线程的不同之处。进程是一个指令执行流及其执行环境,其执行环境是一个系统资源的集合。在调用系统调用fork创建一个进程时,子进程只是完全复制父进程的资源,这样得到的子进程独立于父进程,具有良好的并发性。但是二者之间的通讯需要通过专门的通讯机制,另外通过fork创建子进程系统开销很大。因此,在某些情况下,使用clone或pthread_create创建线程可能更加高效。 ... [详细]
  • JDK源码学习之HashTable(附带面试题)的学习笔记
    本文介绍了JDK源码学习之HashTable(附带面试题)的学习笔记,包括HashTable的定义、数据类型、与HashMap的关系和区别。文章提供了干货,并附带了其他相关主题的学习笔记。 ... [详细]
  • 本文介绍了在iOS开发中使用UITextField实现字符限制的方法,包括利用代理方法和使用BNTextField-Limit库的实现策略。通过这些方法,开发者可以方便地限制UITextField的字符个数和输入规则。 ... [详细]
  • 本文讨论了微软的STL容器类是否线程安全。根据MSDN的回答,STL容器类包括vector、deque、list、queue、stack、priority_queue、valarray、map、hash_map、multimap、hash_multimap、set、hash_set、multiset、hash_multiset、basic_string和bitset。对于单个对象来说,多个线程同时读取是安全的。但如果一个线程正在写入一个对象,那么所有的读写操作都需要进行同步。 ... [详细]
  • 十大经典排序算法动图演示+Python实现
    本文介绍了十大经典排序算法的原理、演示和Python实现。排序算法分为内部排序和外部排序,常见的内部排序算法有插入排序、希尔排序、选择排序、冒泡排序、归并排序、快速排序、堆排序、基数排序等。文章还解释了时间复杂度和稳定性的概念,并提供了相关的名词解释。 ... [详细]
  • Gitlab接入公司内部单点登录的安装和配置教程
    本文介绍了如何将公司内部的Gitlab系统接入单点登录服务,并提供了安装和配置的详细教程。通过使用oauth2协议,将原有的各子系统的独立登录统一迁移至单点登录。文章包括Gitlab的安装环境、版本号、编辑配置文件的步骤,并解决了在迁移过程中可能遇到的问题。 ... [详细]
  • 本文介绍了在go语言中利用(*interface{})(nil)传递参数类型的原理及应用。通过分析Martini框架中的injector类型的声明,解释了values映射表的作用以及parent Injector的含义。同时,讨论了该技术在实际开发中的应用场景。 ... [详细]
  • 感谢大家对IT十八掌大数据的支持,今天的作业如下:1.实践PreparedStament的CRUD操作。2.对比Statement和PreparedStatement的大批量操作耗时?(1 ... [详细]
author-avatar
tengpou_260475
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有