按索引获取 Hazelcast Map 值
Fetch the Hazelcast Map values by index
如何按位置获取 hazelcast 缓存值。
HazelcastInstance hazelCast = Hazelcast.newHazelcastInstance();
IMap<String, String> map = hazelCast.getMap("map1");
map.put("t1", "manu");
map.put("t2", "chite");
map.put("t3", "naveen");
map.put("t4", "vinoda");
我的问题是,有没有什么方法可以按位置取值
喜欢
map.values().position(1)
输出:-
chite
输出:-
嗯,在Java中有不同类型的map实现,你想要的可以用LinkedHashMap或TreeMap来实现,但是Hazelcast的IMap不支持这个。事实上,IMap 与 java 地图完全不同。
This class is not a general-purpose ConcurrentMap implementation! While this class implements the Map interface, it intentionally violates Map's general contract, which mandates the use of the equals method when comparing objects. Instead of the equals method, this implementation compares the serialized byte version of the objects.
Moreover, stored values are handled as having a value type semantics, while standard Java implementations treat them as having a reference type semantics.
如何按位置获取 hazelcast 缓存值。
HazelcastInstance hazelCast = Hazelcast.newHazelcastInstance();
IMap<String, String> map = hazelCast.getMap("map1");
map.put("t1", "manu");
map.put("t2", "chite");
map.put("t3", "naveen");
map.put("t4", "vinoda");
我的问题是,有没有什么方法可以按位置取值
喜欢
map.values().position(1)
输出:-
chite
输出:-
嗯,在Java中有不同类型的map实现,你想要的可以用LinkedHashMap或TreeMap来实现,但是Hazelcast的IMap不支持这个。事实上,IMap 与 java 地图完全不同。
This class is not a general-purpose ConcurrentMap implementation! While this class implements the Map interface, it intentionally violates Map's general contract, which mandates the use of the equals method when comparing objects. Instead of the equals method, this implementation compares the serialized byte version of the objects. Moreover, stored values are handled as having a value type semantics, while standard Java implementations treat them as having a reference type semantics.