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

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

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

Hashtable.values介绍

[英]Returns a collection of the values contained in this Hashtable. The collection is backed by this Hashtable so changes to one are reflected by the other. The collection does not support adding.
[中]返回此哈希表中包含的值的集合。集合由该哈希表支持,因此对一个哈希表的更改将由另一个哈希表反映。集合不支持添加。

代码示例

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

public List<Region> getRegions() {
 if (this.m_regionsList == null) {
  this.m_regionsList = new ArrayList<Region>(this.m_regions.values());
 }
 return this.m_regionsList;
}

代码示例来源:origin: commons-logging/commons-logging

/**
 *@see Hashtable
 */
public Collection values() {
  purge();
  return super.values();
}

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

@Override
public Collection<V> values() {
  ArrayList<V> result = new ArrayList<V>(map.values());
  for (int i = 0; i < nulls.size(); i++) {
    result.add(null);
  }
  return result;
}

代码示例来源:origin: Dreampie/Resty

public UploadedFile getUploadedFileFirst() {
 return uploadedFiles != null && uploadedFiles.size() > 0 ? uploadedFiles.values().iterator().next() : null;
}

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

public Collection values() {
  return project.getProperties().values();
}

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

/**
 *@see Hashtable
 */      
public Collection values() {
  purge();
  return super.values();
}

代码示例来源:origin: org.apache.ant/ant

/**
   * Create a list of all definitions that match a prefix, usually the URI
   * of a library
   * @param prefix prefix to match off
   * @return the (possibly empty) list of definitions
   */
  private List<AntTypeDefinition> findTypeMatches(String prefix) {
    synchronized (antTypeTable) {
      return antTypeTable.values().stream().filter(def -> def.getName().startsWith(prefix))
          .collect(Collectors.toList());
    }
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

/** Fires info about reordering
* @param perm
*/
private void fireFileSystemReordered(int[] perm) {
  RepositoryReorderedEvent ev = new RepositoryReorderedEvent(this, perm);
  for (RepositoryListener list : new HashSet<RepositoryListener>(listeners.values())) {
    list.fileSystemPoolReordered(ev);
  }
}

代码示例来源:origin: org.apache.ant/ant

for (File currentFile : ejbFiles.values()) {
  if (lastBuild < currentFile.lastModified()) {
    log("Build needed because " + currentFile.getPath() + " is out of date",

代码示例来源:origin: org.apache.ant/ant

/**
 * Cleans up any resources held by this classloader. Any open archive
 * files are closed.
 */
public synchronized void cleanup() {
  for (final JarFile jarFile : jarFiles.values()) {
    FileUtils.close(jarFile);
  }
  jarFiles = new Hashtable<>();
  if (project != null) {
    project.removeBuildListener(this);
  }
  project = null;
}

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

private synchronized void readConfigurationImpl(InputStream ins)
    throws IOException {
  reset();
  props.load(ins);
  // The RI treats the root logger as special. For compatibility, always
  // update the root logger's handlers.
  Logger root = loggers.get("");
  if (root != null) {
    root.setManager(this);
  }
  // parse property "config" and apply setting
  String configs = props.getProperty("config");
  if (configs != null) {
    StringTokenizer st = new StringTokenizer(configs, " ");
    while (st.hasMoreTokens()) {
      String configerName = st.nextToken();
      getInstanceByClass(configerName);
    }
  }
  // set levels for logger
  Collection<Logger> allLoggers = loggers.values();
  for (Logger logger : allLoggers) {
    String property = props.getProperty(logger.getName() + ".level");
    if (property != null) {
      logger.setLevel(Level.parse(property));
    }
  }
  listeners.firePropertyChange(null, null, null);
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Used with creating child projects. Each child
 * project inherits the component definitions
 * from its parent.
 * @param helper the component helper of the parent project.
 */
public void initSubProject(ComponentHelper helper) {
  // add the types of the parent project
  @SuppressWarnings("unchecked")
  final Hashtable<String, AntTypeDefinition> typeTable
      = (Hashtable<String, AntTypeDefinition>) helper.antTypeTable.clone();
  synchronized (antTypeTable) {
    for (AntTypeDefinition def : typeTable.values()) {
      antTypeTable.put(def.getName(), def);
    }
  }
  // add the parsed namespaces of the parent project
  Set<String> inheritedCheckedNamespace = helper.getCheckedNamespace();
  synchronized (this) {
    checkedNamespaces.addAll(inheritedCheckedNamespace);
  }
  Map<String, List<AntTypeDefinition>> inheritedRestrictedDef
      = helper.getRestrictedDefinition();
  synchronized (restrictedDefinitions) {
    restrictedDefinitions.putAll(inheritedRestrictedDef);
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

/** Fire info about changes in the filesystem pool.
* @param fs filesystem
* @param add <CODE>true</CODE> if the filesystem is added,
*   <CODE>false</CODE> if it is removed
*/
private void fireFileSystem(FileSystem fs, boolean add) {
  RepositoryEvent ev = new RepositoryEvent(this, fs, add);
  for (RepositoryListener list : new HashSet<RepositoryListener>(listeners.values())) {
    if (add) {
      list.fileSystemAdded(ev);
    } else {
      list.fileSystemRemoved(ev);
    }
  }
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Returns a description of the type of the given element.
 * <p>
 * This is useful for logging purposes.
 *
 * @param o     The element to describe.
 *              Must not be <code>null</code>.
 * @param brief whether to use a brief description.
 * @return a description of the element type.
 *
 * @since Ant 1.7
 */
public String getElementName(Object o, boolean brief) {
  //  PR: I do not know what to do if the object class
  //      has multiple defines
  //      but this is for logging only...
  Class<?> elementClass = o.getClass();
  String elementClassname = elementClass.getName();
  synchronized (antTypeTable) {
    for (AntTypeDefinition def : antTypeTable.values()) {
      if (elementClassname.equals(def.getClassName())
          && (elementClass == def.getExposedClass(project))) {
        String name = def.getName();
        return brief ? name : "The <" + name + "> type";
      }
    }
  }
  return getUnmappedElementName(o.getClass(), brief);
}

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

Collection<Logger> allLoggers = loggers.values();
for (final Logger child : allLoggers) {
  Logger oldParent = child.getParent();

代码示例来源:origin: org.apache.ant/ant

for (final String[] dirs : dirCopyMap.values()) {
  for (String dir : dirs) {
    final File d = new File(dir);

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

@Override
public Collection<V> values() {
  ArrayList<V> result = new ArrayList<V>(map.values());
  for (int i = 0; i < nulls.size(); i++) {
    result.add(null);
  }
  return result;
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 *@see Hashtable
 */      
public Collection values() {
  purge();
  return super.values();
}

代码示例来源:origin: limpoxe/Android-Plugin-Framework

PluginDescriptor getPluginDescriptorByClassName(String clazzName) {
  Iterator<PluginDescriptor> itr = sInstalledPlugins.values().iterator();
  while (itr.hasNext()) {
    PluginDescriptor descriptor = itr.next();
    if (descriptor.containsName(clazzName)) {
      return descriptor;
    }
  }
  return null;
}

代码示例来源:origin: curtis2/SuperVideoPlayer

protected static synchronized void reset() {
 for (MiniThumbFile file : sThumbFiles.values())
  file.deactivate();
 sThumbFiles.clear();
}

相关文章