performance - How to implement tire map in java? -


i want tire map blow:

map<string,object> map = new tiremap(); map.put("com","1"); map.put("com.aa","2"); map.put("com.aa.bb","3");  map.get("com");// return ["1","2","3"] map.get("com.a"); //return ["2","3"] map.get("com.aa"); //return ["2","3"] // key maybe full key or key prefix 

how implement map this? or there exits map in java api or open source?

it's innodb in mysql.

ps: performance important. storage items more 1000w.

i try out treemap java.util. map u need. manages keys based on natural order (defined comparator in key class). methods tailmap , headmap gives map keys need.

example

public static void main(string[] args) {     treemap<string, object> map = new treemap<string, object>();      map.put("com","1");     map.put("com.aa","2");     map.put("com.aa.bb","3");      system.out.println(map.get("com"));     system.out.println(map.tailmap("com").values()); // ["1","2","3"]      system.out.println(map.get("com.aa")); //return ["2","3"]     system.out.println(map.tailmap("com.aa").values()); } 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -