Apache OrderedMap接口

OrderedMap是映射的新接口,用于保留添加元素的顺序。

public class OrderedMapTester {
    public static void main(String[] args) {
        OrderedMap<String,String> map = new LinkedMap<String, String>();
        map.put("One","1");
        map.put("Two","2");
        map.put("Three","3");
        map.put("Four","4");

        System.out.println(map.firstKey());
        System.out.println(map.lastKey());
        System.out.println(map.nextKey("Three"));
    }
}
阁下何不同风起,扶摇直上九万里。
原文地址:https://www.cnblogs.com/mlyun/p/10839777.html