org.neodatis.odb.core.layers.layer2.meta
Class NonNativeObjectInfo
- java.lang.Object
-
- org.neodatis.odb.core.layers.layer2.meta.AbstractObjectInfo
-
- org.neodatis.odb.core.layers.layer2.meta.NonNativeObjectInfo
-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- ClientNonNativeObjectInfo, NonNativeDeletedObjectInfo, NonNativeNullObjectInfo
public class NonNativeObjectInfo extends AbstractObjectInfo
To keep info about a non native object. The NonNativeObjectInfo is the meta representation and is a class of the Layer in NeoDatis architecture (http://wiki.neodatis.org/odb-layers). The NonNativeObjectInfo (nnoi) contains all the data of the attributes of an objects.* The object The type of the object (org.neodatis.odb.core.meta.ODBType) The ClassInfo of the object The list of attributes (list of AbstractObjectInfo) The ObjectInfoHeader that holds : o The object position (in the ODB file) o The Object OID o The previous Object OID o The next object OID o The ClassInfo OID o The ids (local id, to idenitfy the attribute) of the attributes o The OID or position of the attributes- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description NonNativeObjectInfo()NonNativeObjectInfo(ClassInfo classInfo)NonNativeObjectInfo(java.lang.Object object, ClassInfo info, AbstractObjectInfo[] values, long[] attributesIdentification, int[] attributeIds)NonNativeObjectInfo(ObjectInfoHeader oip, ClassInfo classInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclear()AbstractObjectInfocreateCopy(java.util.Map<OID,AbstractObjectInfo> cache, boolean onlyData)Create a copy oh this meta objectbooleanequals(java.lang.Object obj)longgetAttributeDefinitionPosition(int attributeId)Return the position where the position of an attribute is stored.intgetAttributeId(AbstractObjectInfo aoi)The performance of this method is bad.AbstractObjectInfogetAttributeValueFromId(int attributeId)Return The meta representation of an attribute from its attribute id.AbstractObjectInfo[]getAttributeValues()ClassInfogetClassInfo()Return the class info of the object.ObjectInfoHeadergetHeader()intgetMaxNbattributes()AbstractObjectInfogetMetaValueOf(java.lang.String attributeName)Return the value of the attribute 'attribute name'.OIDgetNextObjectOID()Returns the oid of the next object of the same typejava.lang.ObjectgetObject()Gets the actual java object.OIDgetOid()Return the oid of the objectlonggetPosition()Gets the physical position of the object in the NeoDatis database fileOIDgetPreviousObjectOID()Returns the oid of the previous object of the same typejava.lang.ObjectgetValueOf(java.lang.String attributeName)Return the value of the attribute 'attribute name'inthashCode()booleanisNonNativeObject()To indicate that this is a non native object infobooleanisNull()voidsetAttributeValue(int attributeId, AbstractObjectInfo aoi)voidsetClassInfo(ClassInfo classInfo)voidsetHeader(ObjectInfoHeader header)voidsetNextObjectOID(OID nextObjectOID)voidsetObject(java.lang.Object object)voidsetOid(OID oid)Sets the oid of the objectvoidsetPosition(long position)voidsetPreviousInstanceOID(OID previousObjectOID)voidsetValueOf(java.lang.String attributeName, AbstractObjectInfo aoi)Used to change the value of an attributejava.lang.StringtoString()-
Methods inherited from class org.neodatis.odb.core.layers.layer2.meta.AbstractObjectInfo
getOdbType, getOdbTypeId, isArrayObject, isAtomicNativeObject, isCollectionObject, isDeletedObject, isEnumObject, isGroup, isMapObject, isNative, isObjectReference, setOdbType, setOdbTypeId
-
-
-
-
Constructor Detail
-
NonNativeObjectInfo
public NonNativeObjectInfo()
-
NonNativeObjectInfo
public NonNativeObjectInfo(ObjectInfoHeader oip, ClassInfo classInfo)
-
NonNativeObjectInfo
public NonNativeObjectInfo(ClassInfo classInfo)
-
NonNativeObjectInfo
public NonNativeObjectInfo(java.lang.Object object, ClassInfo info, AbstractObjectInfo[] values, long[] attributesIdentification, int[] attributeIds)
-
-
Method Detail
-
getHeader
public ObjectInfoHeader getHeader()
-
getAttributeValueFromId
public AbstractObjectInfo getAttributeValueFromId(int attributeId)
Return The meta representation of an attribute from its attribute id. Attribute ids are sequencial number(starting from 1) set by the classIntropector to identify attributes- Parameters:
attributeId-- Returns:
-
getClassInfo
public ClassInfo getClassInfo()
Return the class info of the object. The Class Info is a meta representation of the java class- Returns:
-
setClassInfo
public void setClassInfo(ClassInfo classInfo)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getNextObjectOID
public OID getNextObjectOID()
Returns the oid of the next object of the same type- Returns:
-
setNextObjectOID
public void setNextObjectOID(OID nextObjectOID)
-
getPreviousObjectOID
public OID getPreviousObjectOID()
Returns the oid of the previous object of the same type- Returns:
-
setPreviousInstanceOID
public void setPreviousInstanceOID(OID previousObjectOID)
-
getPosition
public long getPosition()
Gets the physical position of the object in the NeoDatis database file- Overrides:
getPositionin classAbstractObjectInfo
-
setPosition
public void setPosition(long position)
- Overrides:
setPositionin classAbstractObjectInfo
-
getObject
public java.lang.Object getObject()
Gets the actual java object. May return null on client server mode as Client Server mode does work with java objects (layer1)- Specified by:
getObjectin classAbstractObjectInfo
-
getValueOf
public java.lang.Object getValueOf(java.lang.String attributeName)
Return the value of the attribute 'attribute name'For example, if the class User has 2 attributes (name of type String, and profile of type Profile) calling getValueOf("name") on a nnoi (NonNativeObjectInfo) that represents an instance of User will return its name- Parameters:
attributeName-- Returns:
-
getMetaValueOf
public AbstractObjectInfo getMetaValueOf(java.lang.String attributeName)
Return the value of the attribute 'attribute name'. Same as getValueOf, except that the object return is a meta representation of the real object : an AbstractObjectInfo (NonNative ObjectInfo, NativeObjectnfo,....)For example, if the class User has 2 attributes (name of type String, and profile of type Profile) calling getValueOf("name") on a nnoi (NonNativeObjectInfo) that represents an instance of User will return its name- Parameters:
attributeName-- Returns:
-
setValueOf
public void setValueOf(java.lang.String attributeName, AbstractObjectInfo aoi)Used to change the value of an attribute- Parameters:
attributeName-aoi-
-
getOid
public OID getOid()
Return the oid of the object- Returns:
- The oid
-
setOid
public void setOid(OID oid)
Sets the oid of the object- Parameters:
oid-
-
isNonNativeObject
public boolean isNonNativeObject()
To indicate that this is a non native object info- Overrides:
isNonNativeObjectin classAbstractObjectInfo
-
isNull
public boolean isNull()
- Overrides:
isNullin classAbstractObjectInfo
-
clear
public void clear()
-
createCopy
public AbstractObjectInfo createCopy(java.util.Map<OID,AbstractObjectInfo> cache, boolean onlyData)
Create a copy oh this meta object- Specified by:
createCopyin classAbstractObjectInfo- Parameters:
onlyData- if true, only copy attributes values- Returns:
-
setAttributeValue
public void setAttributeValue(int attributeId, AbstractObjectInfo aoi)
-
getAttributeValues
public AbstractObjectInfo[] getAttributeValues()
-
getMaxNbattributes
public int getMaxNbattributes()
-
getAttributeId
public int getAttributeId(AbstractObjectInfo aoi)
The performance of this method is bad. But it is not used by the engine, only in the ODBExplorer- Parameters:
aoi-- Returns:
-
getAttributeDefinitionPosition
public long getAttributeDefinitionPosition(int attributeId)
Return the position where the position of an attribute is stored.If a object has 3 attributes and if it is stored at position x Then the number of attributes (3) is stored at x+StorageEngineConstant.OBJECT_OFFSET_NB_ATTRIBUTES and first attribute id definition is stored at x+StorageEngineConstant.OBJECT_OFFSET_NB_ATTRIBUTES+size-of(int) and first attribute position is stored at x+StorageEngineConstant.OBJECT_OFFSET_NB_ATTRIBUTES+size-of(int)+size-of(int) the second attribute id is stored at x+StorageEngineConstant.OBJECT_OFFSET_NB_ATTRIBUTES+size-of(int)+size-of(int)+size-of(long) the second attribute position is stored at x+StorageEngineConstant.OBJECT_OFFSET_NB_ATTRIBUTES+size-of(int)+size-of(int)+size-of(long)+size-of(int)FIXME Remove dependency of StorageEngineConstant!
- Parameters:
attributeId-- Returns:
- The position where this attribute is stored
-
setObject
public void setObject(java.lang.Object object)
- Specified by:
setObjectin classAbstractObjectInfo
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
setHeader
public void setHeader(ObjectInfoHeader header)
- Parameters:
header-
-
-
DataMelt 3.0 © DataMelt by jWork.ORG