org.erights.e.elib.tables
Class FlexBijection

java.lang.Object
  |
  +--org.erights.e.elib.tables.EMap
        |
        +--org.erights.e.elib.tables.FlexMap
              |
              +--org.erights.e.elib.tables.FlexBijection
All Implemented Interfaces:
EPrintable, Iteratable, Marker, PassByProxy, Persistent, Serializable

Deprecated. You should probably use FlexTrijection instead, and we should eventually probably kill FlexBijection.

public class FlexBijection
extends FlexMap

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.

Author:
Mark S. Miller
See Also:
Serialized Form

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

serialVersionUID

static final long serialVersionUID
Deprecated. 

myForwardMap

private final FlexMap myForwardMap
Deprecated. 

myBackMap

private final FlexMap myBackMap
Deprecated. 

myInverse

private final FlexBijection myInverse
Deprecated. 
Constructor Detail

FlexBijection

private FlexBijection(FlexMap forwardMap,
                      FlexMap backMap,
                      FlexBijection inverse)
Deprecated. 

FlexBijection

public FlexBijection(Class optKeyType,
                     Class optValType)
Deprecated. 
Enabled:

Parameters:
optKeyType - defaults to Object.class
optValType - defaults to Object.class

FlexBijection

public FlexBijection()
Deprecated. 
Enabled: Defaults to (Object.class, Object.class)

Method Detail

put

public void put(Object key,
                Object value,
                boolean strict)
Deprecated. 
Enabled: On a FlexBijection, puts are always strict, so the strict flag is ignored.

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.

Specified by:
put in class FlexMap
Parameters:
key -
value -
strict -
Throws:
NotSettledException
See Also:
org.erights.e.elib.ref.Ref#isSettled

removeKey

public void removeKey(Object key,
                      boolean strict)
Deprecated. 
Enabled:

Specified by:
removeKey in class FlexMap
Parameters:
key -
strict -

removeAll

public void removeAll()
Deprecated. 
Enabled:

Specified by:
removeAll in class FlexMap

size

public int size()
Deprecated. 
Enabled:

Specified by:
size in class EMap
Returns:

get

public Object get(Object key,
                  Object instead)
Deprecated. 
Enabled:

Specified by:
get in class EMap
Parameters:
key -
instead -
Returns:
Throws:
NotSettledException
See Also:
org.erights.e.elib.ref.Ref#isSettled

getKeys

public Object getKeys(Class type)
Deprecated. 
Enabled:

Specified by:
getKeys in class EMap
Parameters:
type -
Returns:

getValues

public Object getValues(Class type)
Deprecated. 
Enabled:

Specified by:
getValues in class EMap
Parameters:
type -
Returns:

keyType

public Class keyType()
Deprecated. 
Enabled:

Specified by:
keyType in class EMap
Returns:

valueType

public Class valueType()
Deprecated. 
Enabled:

Specified by:
valueType in class EMap
Returns:

getInverse

public FlexBijection getInverse()
Deprecated. 
Enabled:

Returns:


comments?