org.objectweb.jorm.facility.naming.olongid
Class LongIdPNC

java.lang.Object
  extended byorg.objectweb.jorm.naming.lib.BasicPNamingContext
      extended byorg.objectweb.jorm.naming.lib.AbstractInheritKeyFilteredPNamingContext
          extended byorg.objectweb.jorm.facility.naming.olongid.LongIdPNC
All Implemented Interfaces:
KeyFilteredNamingContext, PNameCoder, PNameManager, PNamingContext

public class LongIdPNC
extends AbstractInheritKeyFilteredPNamingContext

Is a PNamingContext managing the LongIdPName and LongIdBinder. It is based on the AbstractInheritKeyFilteredPNamingContext class. The key is the class identifier. The filter (evaluate method) is in charge to extract the class identifier from the identifier (long value). Indeed the long value is composed of two parts the high bits describe the class identifier, whereas the low bits describes the object instance identifier. The limit between both parts are defined are building time (constructor).

Author:
S.Chassande-Barrioz

Field Summary
 
Fields inherited from class org.objectweb.jorm.naming.lib.AbstractInheritKeyFilteredPNamingContext
codingType, expressionType, key2binder, nullPName, nullValue, pngConverter
 
Fields inherited from class org.objectweb.jorm.naming.lib.BasicPNamingContext
ptype
 
Fields inherited from interface org.objectweb.jorm.naming.api.PNameCoder
CTBIGDECIMAL, CTBIGINTEGER, CTBYTE, CTBYTEARRAY, CTCHAR, CTCHARARRAY, CTCOMPOSITE, CTDATE, CTINT, CTLONG, CTOBYTE, CTOCHAR, CTOINT, CTOLONG, CTOSHORT, CTSHORT, CTSTRING, CTSYSTEM
 
Constructor Summary
LongIdPNC(int cidsize)
          Builds a LongIdPNC with a particular class identifier size
 
Method Summary
 java.lang.Object evaluate(java.lang.Object png, java.lang.Object ctx)
          Calculates the class identifier from the long identifier value
 int getCidSize()
           
 boolean isNull(java.lang.Object _png, java.lang.Object ctx)
           
 void setCidSize(int cidSize)
           
 void setNullPName(java.lang.Object o)
          It assignes a object which defines a null representation of a name within this naming context.
 void setPType(PType pt)
          Assigns the PType associated to the JORM class which is the type of the name managed by this naming context.
 
Methods inherited from class org.objectweb.jorm.naming.lib.AbstractInheritKeyFilteredPNamingContext
codingSupported, decode, decodeAbstract, decodeBigDecimal, decodeBigInteger, decodeByte, decodeChar, decodeCharArray, decodeDate, decodeInt, decodeLong, decodeObyte, decodeOchar, decodeOint, decodeOlong, decodeOshort, decodeShort, decodeString, encode, encodeAbstract, encodeBigDecimal, encodeBigInteger, encodeByte, encodeChar, encodeCharArray, encodeDate, encodeInt, encodeLong, encodeObyte, encodeOchar, encodeOint, encodeOlong, encodeOshort, encodeShort, encodeString, entries, export, export, exportClass, getExpressionType, getNull, init, lookup, resolve, setCodingType, setExpressionType, unexport, unexport, unexportClass
 
Methods inherited from class org.objectweb.jorm.naming.lib.BasicPNamingContext
getPType, supportCompositeField, supportDynamicComposite, supportStaticComposite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jorm.naming.api.PNameCoder
getPType, supportCompositeField, supportDynamicComposite, supportStaticComposite
 

Constructor Detail

LongIdPNC

public LongIdPNC(int cidsize)
          throws PException
Builds a LongIdPNC with a particular class identifier size

Parameters:
cidsize - is the number of bits allocated for the class identifier among the number of bits of a long value (64).
Method Detail

getCidSize

public int getCidSize()
See Also:
this.cidSize

setCidSize

public void setCidSize(int cidSize)
See Also:
this.cidSize

evaluate

public java.lang.Object evaluate(java.lang.Object png,
                                 java.lang.Object ctx)
                          throws PException
Calculates the class identifier from the long identifier value

Specified by:
evaluate in interface KeyFilteredNamingContext
Specified by:
evaluate in class AbstractInheritKeyFilteredPNamingContext
Parameters:
png - is a PNameGetter or a Long instance
ctx - is the context used for evaluate the PNameGetter
Returns:
a Long instance containing the class identifier
Throws:
PException - if it is not possible to fetch the long value, or if the png parameter is not managed.

setNullPName

public void setNullPName(java.lang.Object o)
                  throws PException
Description copied from interface: PNameCoder
It assignes a object which defines a null representation of a name within this naming context.

Specified by:
setNullPName in interface PNameCoder
Overrides:
setNullPName in class AbstractInheritKeyFilteredPNamingContext
Parameters:
o - must be the null PName
Throws:
PException

isNull

public boolean isNull(java.lang.Object _png,
                      java.lang.Object ctx)
               throws PException
Overrides:
isNull in class AbstractInheritKeyFilteredPNamingContext
Throws:
PException

setPType

public void setPType(PType pt)
Description copied from interface: PNameCoder
Assigns the PType associated to the JORM class which is the type of the name managed by this naming context.

Specified by:
setPType in interface PNameCoder
Overrides:
setPType in class BasicPNamingContext