What I need is a collection which allows multiple keys to access a single object.
I need to apply frequent alterations to this object.
It also must be effici
this may do what you want:
import java.util.*;
class Value {
public String toString() {
return x.toString();
}
Integer x=0;
}
public class Main {
public static void main(String[] arguments) {
Map m=new HashMap();
final Value v=new Value();
m.put(1,v);
m.put(2,v);
System.out.println(m.get(1));
System.out.println(m.get(2));
v.x=42;
System.out.println(m.get(1));
System.out.println(m.get(2));
}