|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.neodatis.odb.core.layers.layer2.meta.AbstractObjectInfo
org.neodatis.odb.core.layers.layer2.meta.NonNativeObjectInfo
public class NonNativeObjectInfo
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
Field Summary | |
---|---|
protected java.lang.Object |
object
The object being represented |
Fields inherited from class org.neodatis.odb.core.layers.layer2.meta.AbstractObjectInfo |
---|
odbType, odbTypeId, position |
Constructor Summary | |
---|---|
NonNativeObjectInfo()
|
|
NonNativeObjectInfo(ClassInfo classInfo)
|
|
NonNativeObjectInfo(java.lang.Object object,
ClassInfo info,
AbstractObjectInfo[] values,
long[] attributesIdentification,
int[] attributeIds)
|
|
NonNativeObjectInfo(ObjectInfoHeader oip,
ClassInfo classInfo)
|
Method Summary | |
---|---|
void |
clear()
|
AbstractObjectInfo |
createCopy(java.util.Map<OID,AbstractObjectInfo> cache,
boolean onlyData)
Create a copy oh this meta object |
boolean |
equals(java.lang.Object obj)
|
long |
getAttributeDefinitionPosition(int attributeId)
Return the position where the position of an attribute is stored. |
int |
getAttributeId(AbstractObjectInfo aoi)
The performance of this method is bad. |
AbstractObjectInfo |
getAttributeValueFromId(int attributeId)
Return The meta representation of an attribute from its attribute id. |
AbstractObjectInfo[] |
getAttributeValues()
|
ClassInfo |
getClassInfo()
Return the class info of the object. |
ObjectInfoHeader |
getHeader()
|
int |
getMaxNbattributes()
|
AbstractObjectInfo |
getMetaValueOf(java.lang.String attributeName)
Return the value of the attribute 'attribute name'. |
OID |
getNextObjectOID()
Returns the oid of the next object of the same type |
java.lang.Object |
getObject()
Gets the actual java object. |
OID |
getOid()
Return the oid of the object |
long |
getPosition()
Gets the physical position of the object in the NeoDatis database file |
OID |
getPreviousObjectOID()
Returns the oid of the previous object of the same type |
java.lang.Object |
getValueOf(java.lang.String attributeName)
Return the value of the attribute 'attribute name' |
int |
hashCode()
|
boolean |
isNonNativeObject()
To indicate that this is a non native object info |
boolean |
isNull()
|
void |
setAttributeValue(int attributeId,
AbstractObjectInfo aoi)
|
void |
setClassInfo(ClassInfo classInfo)
|
void |
setHeader(ObjectInfoHeader header)
|
void |
setNextObjectOID(OID nextObjectOID)
|
void |
setObject(java.lang.Object object)
|
void |
setOid(OID oid)
Sets the oid of the object |
void |
setPosition(long position)
|
void |
setPreviousInstanceOID(OID previousObjectOID)
|
void |
setValueOf(java.lang.String attributeName,
AbstractObjectInfo aoi)
Used to change the value of an attribute |
java.lang.String |
toString()
|
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 |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected transient java.lang.Object object
Constructor Detail |
---|
public NonNativeObjectInfo()
public NonNativeObjectInfo(ObjectInfoHeader oip, ClassInfo classInfo)
public NonNativeObjectInfo(ClassInfo classInfo)
public NonNativeObjectInfo(java.lang.Object object, ClassInfo info, AbstractObjectInfo[] values, long[] attributesIdentification, int[] attributeIds)
Method Detail |
---|
public ObjectInfoHeader getHeader()
public AbstractObjectInfo getAttributeValueFromId(int attributeId)
attributeId
-
public ClassInfo getClassInfo()
public void setClassInfo(ClassInfo classInfo)
public java.lang.String toString()
toString
in class java.lang.Object
public OID getNextObjectOID()
public void setNextObjectOID(OID nextObjectOID)
public OID getPreviousObjectOID()
public void setPreviousInstanceOID(OID previousObjectOID)
public long getPosition()
getPosition
in class AbstractObjectInfo
public void setPosition(long position)
setPosition
in class AbstractObjectInfo
public java.lang.Object getObject()
getObject
in class AbstractObjectInfo
public java.lang.Object getValueOf(java.lang.String attributeName)
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
attributeName
-
public AbstractObjectInfo getMetaValueOf(java.lang.String attributeName)
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
attributeName
-
public void setValueOf(java.lang.String attributeName, AbstractObjectInfo aoi)
attributeName
- aoi
- public OID getOid()
public void setOid(OID oid)
oid
- public boolean isNonNativeObject()
isNonNativeObject
in class AbstractObjectInfo
public boolean isNull()
isNull
in class AbstractObjectInfo
public void clear()
public AbstractObjectInfo createCopy(java.util.Map<OID,AbstractObjectInfo> cache, boolean onlyData)
createCopy
in class AbstractObjectInfo
onlyData
- if true, only copy attributes values
public void setAttributeValue(int attributeId, AbstractObjectInfo aoi)
public AbstractObjectInfo[] getAttributeValues()
public int getMaxNbattributes()
public int getAttributeId(AbstractObjectInfo aoi)
aoi
-
public long getAttributeDefinitionPosition(int attributeId)
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!
attributeId
-
public void setObject(java.lang.Object object)
setObject
in class AbstractObjectInfo
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void setHeader(ObjectInfoHeader header)
header
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |