java.util.Hashtable.containsValue()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(185)

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

Hashtable.containsValue介绍

[英]Searches this Hashtable for the specified value.
[中]在此哈希表中搜索指定的值。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Returns true if this {@code Hashtable} contains the specified object as
 * the value of at least one of the key/value pairs.
 *
 * @param value
 *            the object to look for as a value in this {@code Hashtable}.
 * @return {@code true} if object is a value in this {@code Hashtable},
 *         {@code false} otherwise.
 * @see #containsKey
 * @see java.lang.Object#equals
 */
public boolean contains(Object value) {
  return containsValue(value);
}

代码示例来源:origin: eclipsesource/J2V8

@Override
public boolean containsValue(final Object value) {
  if ((value == null) && !nulls.isEmpty()) {
    return true;
  } else if (value == null) {
    return false;
  }
  return map.containsValue(value);
}

代码示例来源:origin: apache/groovy

public boolean containsValue(Object value) {
  return project.getProperties().containsValue(value);
}

代码示例来源:origin: spotbugs/spotbugs

public void hashtablesCantContainNull(Hashtable h) {
    h.put("a", null);
    h.put(null, "a");
    h.get(null);
    h.contains(null);
    h.containsKey(null);
    h.containsValue(null);
    h.remove(null);

  }
}

代码示例来源:origin: spotbugs/spotbugs

@ExpectWarning("GC_UNRELATED_TYPES")
public boolean testContainsValueHashtable(String s) {
  return hashtable.containsValue(s);
}

代码示例来源:origin: spotbugs/spotbugs

@NoWarning("GC_UNRELATED_TYPES")
public boolean testContainsValueHashtable(Integer i) {
  return hashtable.containsValue(i);
}

代码示例来源:origin: plutext/docx4j

/**
 * Removes the mapping associated to the specified prefix.
 *
 * @param prefix The prefix which mapping should be removed.
 */
private void removeIfNeeded(String prefix) {
 // remove the previous mapping to the prefix
 if (this.prefixMapping.containsValue(prefix)) {
  Object key = null;
  for (Enumeration<String> e = this.prefixMapping.keys(); e.hasMoreElements();) {
   key = e.nextElement();
   if (this.prefixMapping.get(key).equals(prefix)) {
    break;
   }
  }
  this.prefixMapping.remove(key); // we know key should have a value
 }
}

代码示例来源:origin: Sable/soot

List<Unit> handlerPreds = this.unitToPreds.get(handler);
for (Iterator<Unit> preditr = handlerPreds.iterator(); preditr.hasNext();) {
 if (try2nop.containsValue(preditr.next())) {
  continue AddExceptionalEdge;

代码示例来源:origin: xalan/xalan

(_prefixMapping.containsValue(Constants.XSLT_URI) == false))
_rootNamespaceDef = false;
else

代码示例来源:origin: eclipsesource/J2V8

@Override
public boolean containsValue(final Object value) {
  if ((value == null) && !nulls.isEmpty()) {
    return true;
  } else if (value == null) {
    return false;
  }
  return map.containsValue(value);
}

代码示例来源:origin: org.codehaus.castor/castor-jdo

/**
 * {@inheritDoc}
 */
public boolean containsValue(final Object value) {
  return _map.containsValue(value);
}

代码示例来源:origin: org.scijava/j3dcore

/**
 * Returns true if the specified value is contained in this Map
 */
@Override
public boolean containsValue(Object value) {
return table.containsValue(value);
}

代码示例来源:origin: org.apache.ctakes/ctakes-utils

/**
 * Checks whether this XCAS file has the specified <code>XcasAnnotation</code>.
 * If there is an <code>XcasAnnotation</code> object that has exactly the same
 * type, attributes, and references, return <code>true</code>.
 * @param a An <code>XcasAnnotation</code> to check.
 * @return <code>true</code> if there is one <code>XcasAnnotation</code> equals
 *         the specified one, <code>false</code> otherwise.
 * @see XcasAnnotation#equals(Object)
 */
public boolean hasAnnotation (XcasAnnotation a) { return annotations.containsValue(a); }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

/**
 * @see java.util.Hashtable#containsValue(java.lang.Object)
 */
@Override
public boolean containsValue(Object value) {
  return this.getDelegate().containsValue(value);
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * @see java.util.Hashtable#containsValue(java.lang.Object)
 */
@Override
public boolean containsValue(Object value) {
  return this.getDelegate().containsValue(value);
}

代码示例来源:origin: apache/servicemix-bundles

public boolean containsValue(Object value)
{
  if (tags == null) {
    tags = new Hashtable<String,Object>();
    copyToHashtable();
  }
  return tags.containsValue(value);
}

代码示例来源:origin: toplink.essentials/toplink-essentials

/**
 * @see java.util.Hashtable#containsValue(java.lang.Object)
 */
public boolean containsValue(Object value) {
  return this.getDelegate().containsValue(value);
}

代码示例来源:origin: org.kohsuke.httpunit/httpunit

public Attr removeAttributeNode( Attr oldAttr ) throws DOMException {
  if (!_attributes.containsValue( oldAttr)) throw new DOMException( DOMException.NOT_FOUND_ERR, "Specified attribute is not defined for this element" );
  AttrImpl removedAttr = (AttrImpl) _attributes.remove( oldAttr.getName() );
  if (removedAttr != null) removedAttr.setOwnerElement( null );
  return removedAttr;
}

代码示例来源:origin: httpunit/httpunit

public Attr removeAttributeNode( Attr oldAttr ) throws DOMException {
  if (!_attributes.containsValue( oldAttr)) throw new DOMException( DOMException.NOT_FOUND_ERR, "Specified attribute is not defined for this element" );
  AttrImpl removedAttr = (AttrImpl) _attributes.remove( oldAttr.getName() );
  if (removedAttr != null) removedAttr.setOwnerElement( null );
  return removedAttr;
}

代码示例来源:origin: octo-online/reactive-audit

@Test(expected = ReactiveAuditException.class)
public void containsValue()
{
  ReactiveAudit.off.commit();
  Hashtable hash=new Hashtable();
  TestTools.strict.commit();
  hash.containsValue(null);
}
@Test(expected = ReactiveAuditException.class)

相关文章