Documentation of 'org.neodatis.odb.core.layers.layer2.meta.NonNativeObjectInfo' Java class
NonNativeObjectInfo
org.neodatis.odb.core.layers.layer2.meta

Class 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 Detail

      • NonNativeObjectInfo

        public NonNativeObjectInfo()
      • NonNativeObjectInfo

        public NonNativeObjectInfo(ClassInfo classInfo)
      • NonNativeObjectInfo

        public NonNativeObjectInfo(java.lang.Object object,
                                   ClassInfo info,
                                   AbstractObjectInfo[] values,
                                   long[] attributesIdentification,
                                   int[] attributeIds)
    • Method Detail

      • 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:
        toString in class java.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:
        getPosition in class AbstractObjectInfo
      • 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:
        getObject in class AbstractObjectInfo
      • 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 -
      • clear

        public void clear()
      • setAttributeValue

        public void setAttributeValue(int attributeId,
                                      AbstractObjectInfo aoi)
      • 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
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • setHeader

        public void setHeader(ObjectInfoHeader header)
        Parameters:
        header -

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.