AbstractMap values - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for AbstractMap values method.

This code example shows how to use the following methods:values
        } 
        return key;
    } 
 
    public Collection<S> getAllShardInfo() {
        return Collections.unmodifiableCollection(nodes.values());
    } 
 
    public Collection<R> getAllShards() {
        return Collections.unmodifiableCollection(resources.values());
    } 
} 
 
7
CodeRank
This code example shows how to use the following methods:values
        assertSame("IdentityHashMap", map5.values(), map5.values());
 
        AbstractMap map6 = new TreeMap();
        assertSame("TreeMap", map6.values(), map6.values());
 
        AbstractMap map7 = new WeakHashMap();
        assertSame("WeakHashMap", map7.values(), map7.values());
    } 
 
    /** 
     * java.util.AbstractMap#clone() 
     */ 
    public void test_clone() { 
        class MyMap extends AbstractMap implements Cloneable {
            private Map map = new HashMap();
 
            public Set entrySet() {
                return map.entrySet();
            } 
 
5
CodeRank
This code example shows how to use the following methods:values
    public Set<String> keySet() {
        return wrappedMap.keySet();
    } 
 
    public Collection<SortedSet<String>> values() {
        return wrappedMap.values();
    } 
 
    public Set<java.util.Map.Entry<String, SortedSet<String>>> entrySet() {
        return wrappedMap.entrySet();
    } 
} 
5
CodeRank
This code example shows how to use the following methods:values, clear, entrySet, keySet, put
    public final void testIsEmpty() { 
        assertEquals(ref.isEmpty(), map.isEmpty());
    } 
     
    public final void testIsEmpty2() { 
        TreeMap<String, String> map = new TreeMap<String, String>();
        map.put("one", "1");
        assertEquals("size should be one", 1, map.size());
        map.clear();
        assertEquals("size should be zero", 0, map.size());
        assertTrue("Should not have entries", !map.entrySet().iterator()
                .hasNext());
 
        map.put("one", "1");
        assertEquals("size should be one", 1, map.size());
        map.remove("one");
        assertEquals("size should be zero", 0, map.size());
        assertTrue("Should not have entries", !map.entrySet().iterator()
                .hasNext());
 

5
CodeRank
This code example shows how to use the following methods:values
    public int size() { 
        return contents.size();
    } 
 
    public Iterator openIterator() {
        return new MemoryIterator(contents.values().iterator());
    } 
 
    public void closeIterator(Iterator close) {
        if (close == null)
            return; 
 
        MemoryIterator it = (MemoryIterator) close;
        it.close();
    } 
 
    class MemoryIterator implements Iterator {
        Iterator it;
 
        MemoryIterator(Iterator iterator) {
4
CodeRank
This code example shows how to use the following methods:values
	public Iterator<T> iterator()
	{ 
		_r.lock();
		try 
		{ 
			return _objectMap.values().iterator();
		} 
		finally 
		{ 
			_r.unlock();
		} 
	} 
 
} 
4
CodeRank
This code example shows how to use the following methods:values, put
    @Override 
    public void setOnTouchListener(OnTouchListener l) {
        super.setOnTouchListener(this);
        if (l == null)
            return; 
        ls.put(l.getClass().getSimpleName(), l);
        lsa = Arrays.copyOf(ls.values().toArray(), ls.values().size(),
                OnTouchListener[].class);
    } 
 
    @Override 
    public boolean onTouch(View v, MotionEvent event) {
        boolean r = false;
        for (OnTouchListener l : lsa)
            r = r || l.onTouch(v, event);
        return r;
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:values
     * Getter of an ArrayList that contains a copy of all objects in the Catalog. 
     * It creates a copy of all elements and can be some ineficient. 
     * @return Unordered ArrayList with all objects in Catalog 
     */ 
    public ArrayList<X> getCopyObjects() {
        return new ArrayList(table.values());
    } 
     
     
    /** 
     * Getter of a Collection that contains all objects in the Catalog. 
     * Note that if you delete/modify an object in colection, it will repercute in the Catalog. But 
     * if you add an object it won't be added to the Catalog. Some errors can happen when the 
     * Catalog is modificated and a old Collection is used. 
     * @return Collection with all objects in Catalog 
     */ 
    public Collection<X> getObjects() {
        return table.values();
    } 
     
4
CodeRank
This code example shows how to use the following methods:values, isEmpty
    public String getTranslation(String language) {
        return translations.get(language);
    } 
 
    public String getSomeTranslation() {
        if (translations.isEmpty()) {
            return null; 
        } 
        return translations.values().iterator().next();
    } 
 
	public String toString() {
		return "TranslateString(" + getSomeTranslation() + ")"; 
	} 
} 
5
CodeRank
This code example shows how to use the following methods:values
     * @param givenFeatures 
     */ 
    public DoubleFeatureSet(Map<String, Function<T, Double>> givenFeatures) {
        super(ImmutableList.copyOf(givenFeatures.keySet()));
 
        TreeMap<String, Function<T, Double>> sortedFeatures = new TreeMap<String, Function<T, Double>>(
                givenFeatures);
        features = ImmutableList.copyOf(sortedFeatures.values());
    } 
 
    /** 
     * Returns a feature representation of the given object. 
     * 
     * @param object 
     * @return a sorted map, mapping feature names to boolean values 
     */ 
    public SortedMap<String, Double> featurize(T object) {
        TreeMap<String, Double> values = new TreeMap<String, Double>();
        for (int i = 0; i < this.getNumFeatures(); i++) {
            String featureName = featureNames.get(i);
4
CodeRank
values Method Overview
Returns a Collection view of the values contained in this map.
See Code Examples for other Java 8 AbstractMap Methods: