Map can solve the O(1) search solution when the key is unique.

But is there a structure in which search by key and search by value both take order O(1)?

Given a structure:

```
Put(key,value)
GetValueOf(Key) in O(1)
GetKeyOf(Value) in O(1)

```

Is there a way such that both searches can be done in order 1 time without using 2 maps ?

I'm particularly interested in java implementations .

Thanks in advance !!