Example usage for java.util Map values

List of usage examples for java.util Map values

Introduction

In this page you can find the example usage for java.util Map values.

Prototype

Collection<V> values();

Source Link

Document

Returns a Collection view of the values contained in this map.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    Map map = new HashMap();
    for (Iterator it = map.values().iterator(); it.hasNext();) {
        Object value = it.next();
    }//from  w  w  w  .  jav  a 2s . c om
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    Map map = new HashMap();
    Object[] objectArray = map.values().toArray();
    MyClass[] array = (MyClass[]) map.values().toArray(new MyClass[map.values().size()]);

}

From source file:Main.java

public static void main(String[] args) {
    Map charsets = Charset.availableCharsets();
    Iterator iterator = charsets.values().iterator();
    while (iterator.hasNext()) {
        Charset cs = (Charset) iterator.next();
        System.out.print(cs.displayName());
        if (cs.isRegistered()) {
            System.out.print(" (registered): ");
        } else {/*from  w ww . j a  va 2  s . c  o m*/
            System.out.print(" (unregistered): ");
        }
        System.out.print(cs.name());
        Iterator names = cs.aliases().iterator();
        while (names.hasNext()) {
            System.out.print(", ");
            System.out.print(names.next());
        }
        System.out.println();
    }
}

From source file:Main.java

public static void main(String[] args) {
    Map<String, Charset> charsets = Charset.availableCharsets();
    Iterator<Charset> iterator = charsets.values().iterator();
    while (iterator.hasNext()) {
        Charset cs = (Charset) iterator.next();
        System.out.println(cs.aliases());
    }/*w w w . j a  va2  s .  com*/
}

From source file:Main.java

public static void main(String[] args) {
    Map<String, Charset> charsets = Charset.availableCharsets();
    Iterator<Charset> iterator = charsets.values().iterator();
    while (iterator.hasNext()) {
        Charset cs = (Charset) iterator.next();
        System.out.print(cs.displayName());
    }/* w  w  w.  j  a v a 2 s  .  c om*/
}

From source file:Main.java

public static void main(String[] args) {
    Map<String, Charset> charsets = Charset.availableCharsets();
    Iterator<Charset> iterator = charsets.values().iterator();
    while (iterator.hasNext()) {
        Charset cs = (Charset) iterator.next();
        System.out.print(cs.displayName(Locale.getDefault()));
    }/*from ww  w.  j  a v  a2 s.co m*/
}

From source file:Main.java

public static void main(String[] args) {
    Map<String, Charset> charsets = Charset.availableCharsets();
    Iterator<Charset> iterator = charsets.values().iterator();
    while (iterator.hasNext()) {
        Charset cs = (Charset) iterator.next();
        System.out.println(cs.displayName());
        System.out.println(cs.hashCode());
    }/*w w  w . ja va  2 s  .co  m*/
}

From source file:Main.java

public static void main(String[] args) {
    Map<String, Charset> charsets = Charset.availableCharsets();
    Iterator<Charset> iterator = charsets.values().iterator();
    while (iterator.hasNext()) {
        Charset cs = (Charset) iterator.next();
        System.out.println(cs.displayName());
        System.out.println(cs.toString());
    }//  w ww  .  ja  v  a  2  s .  co  m
}

From source file:Main.java

public static void main(String[] args) {
    Map<String, Charset> charsets = Charset.availableCharsets();
    Iterator<Charset> iterator = charsets.values().iterator();
    while (iterator.hasNext()) {
        Charset cs = (Charset) iterator.next();
        System.out.println(cs.displayName());
        System.out.println(cs.name());
    }/*  w  ww .  ja  v a2 s  .c  o  m*/
}

From source file:Main.java

public static void main(String[] args) {
    Map<String, Charset> charsets = Charset.availableCharsets();
    Iterator<Charset> iterator = charsets.values().iterator();
    while (iterator.hasNext()) {
        Charset cs = (Charset) iterator.next();
        System.out.println(cs.displayName());
        System.out.println(cs.canEncode());
    }//from  w  w  w  . j av a 2 s. c o  m
}