|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.elib.tables.EMap | +--org.erights.e.elib.tables.FlexMap | +--org.erights.e.elib.tables.FlexBijection
FlexTrijection
instead, and we
should eventually probably kill FlexBijection.
Safe: A mutable bijective mapping.
A FlexBijection is just like a FlexMap except for one restriction and one new feature. The restriction is that stores into the map are only accepted if the key is new and if the value is new. As a result, for every key there is exactly one value (as is normal for a FlexMap), but also, for every value there is exactly one key. Likewise, as is normal for a FlexMap, all keys must be settled. What's novel: all values must be settled as well.
The new feature is enabled by that restriction: you can ask a FlexBijection for its inverse. The two FlexBijections are facets on the same mutable state, so you can query and update this state through either or both.
Field Summary | |
private FlexMap |
myBackMap
Deprecated. |
private FlexMap |
myForwardMap
Deprecated. |
private FlexBijection |
myInverse
Deprecated. |
(package private) static long |
serialVersionUID
Deprecated. |
Fields inherited from class org.erights.e.elib.tables.EMap |
|
Fields inherited from interface org.erights.e.elib.serial.PassByProxy |
HONORARY, HONORED_NAMES |
Fields inherited from interface org.erights.e.elib.serial.Persistent |
HONORARY, HONORED_NAMES |
Constructor Summary | |
|
FlexBijection()
Deprecated. Enabled: Defaults to (Object.class, Object.class) |
|
FlexBijection(Class optKeyType,
Class optValType)
Deprecated. Enabled: |
private |
FlexBijection(FlexMap forwardMap,
FlexMap backMap,
FlexBijection inverse)
Deprecated. |
Method Summary | |
Object |
get(Object key,
Object instead)
Deprecated. Enabled: |
FlexBijection |
getInverse()
Deprecated. Enabled: |
Object |
getKeys(Class type)
Deprecated. Enabled: |
Object |
getValues(Class type)
Deprecated. Enabled: |
Class |
keyType()
Deprecated. Enabled: |
void |
put(Object key,
Object value,
boolean strict)
Deprecated. Enabled: On a FlexBijection, puts are always strict, so the strict flag is ignored. |
void |
removeAll()
Deprecated. Enabled: |
void |
removeKey(Object key,
boolean strict)
Deprecated. Enabled: |
int |
size()
Deprecated. Enabled: |
Class |
valueType()
Deprecated. Enabled: |
Methods inherited from class org.erights.e.elib.tables.FlexMap |
__optUncall, __printOn, clone, domain, fromColumns, fromPairs, fromTypes, fromTypes, interning, interning, make, make, put, putAll, putAll, readOnly, removeKey, removeKeys, removeKeys, snapshot |
Methods inherited from class org.erights.e.elib.tables.EMap |
and, butNot, contains, diverge, diverge, extract, get, getKeys, getPair, getPair, getValues, intersects, iterate, maps, optExtract, or, or, printOn, sortKeys, sortKeys, sortValues, sortValues, toString, with, without |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static final long serialVersionUID
private final FlexMap myForwardMap
private final FlexMap myBackMap
private final FlexBijection myInverse
Constructor Detail |
private FlexBijection(FlexMap forwardMap, FlexMap backMap, FlexBijection inverse)
public FlexBijection(Class optKeyType, Class optValType)
optKeyType
- defaults to Object.classoptValType
- defaults to Object.classpublic FlexBijection()
Method Detail |
public void put(Object key, Object value, boolean strict)
In fact, it's more strict than the normal notion. A FlexBijection insists that both the key and value be unique in their columns. If you want to overwite a previous association, you must remove it first.
put
in class FlexMap
key
- value
- strict
-
NotSettledException
org.erights.e.elib.ref.Ref#isSettled
public void removeKey(Object key, boolean strict)
removeKey
in class FlexMap
key
- strict
- public void removeAll()
removeAll
in class FlexMap
public int size()
size
in class EMap
public Object get(Object key, Object instead)
get
in class EMap
key
- instead
-
NotSettledException
org.erights.e.elib.ref.Ref#isSettled
public Object getKeys(Class type)
getKeys
in class EMap
type
-
public Object getValues(Class type)
getValues
in class EMap
type
-
public Class keyType()
keyType
in class EMap
public Class valueType()
valueType
in class EMap
public FlexBijection getInverse()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |