java - Which Map provides moving objects to different index? -


i need map takes key-value pair (probably hashmap<string, object>) whereas key property of object itself, like:

class person {   string name; //i know string not unique key, ok illustrate example }  person person = new person("john"); map.put(person.getname(), person); 

further, map must provide accessor similar arraylist.add(idx, object). should thereby possible reorder object different position , adjust rest accordingly.

which map/list suitable this?

(by way: should runable gwt, external libs might problematic).

there's no single standard container of this.

however, combination of map , arraylist satisfy of requirements.


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -