Class SingleObjectBundle

  • All Implemented Interfaces:
    ObjectBundle

    public class SingleObjectBundle
    extends java.lang.Object
    implements ObjectBundle
    This class represents a "packaged" object, which is a transfer container for objects, e.g., from parsers to a database. It contains the object with multiple representations outside of any index structure.
    Since:
    0.4.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<java.lang.Object> contents
      Storing the real contents.
      private DBID id
      Object ID
      private BundleMeta meta
      Store the meta data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void append​(SimpleTypeInformation<?> meta, java.lang.Object data)
      Append a single representation to the object.
      boolean assignDBID​(int onum, DBIDVar var)
      Assign the object DBID to a variable
      java.lang.Object data​(int rnum)
      Get the value of the ith component.
      java.lang.Object data​(int onum, int rnum)
      Access a particular object and representation.
      int dataLength()
      Get the number of objects contained.
      BundleMeta meta()
      Access the meta data.
      SimpleTypeInformation<?> meta​(int i)
      Access the meta data.
      int metaLength()
      Get the metadata length.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • meta

        private BundleMeta meta
        Store the meta data.
      • contents

        private java.util.List<java.lang.Object> contents
        Storing the real contents.
      • id

        private DBID id
        Object ID
    • Constructor Detail

      • SingleObjectBundle

        public SingleObjectBundle()
        Constructor.
      • SingleObjectBundle

        public SingleObjectBundle​(BundleMeta meta,
                                  java.util.List<java.lang.Object> contents)
        Constructor.
        Parameters:
        meta - Metadata
        contents - Object values
      • SingleObjectBundle

        public SingleObjectBundle​(BundleMeta meta,
                                  DBID id,
                                  java.util.List<java.lang.Object> contents)
        Constructor.
        Parameters:
        meta - Metadata
        id - ID of object
        contents - Object values
    • Method Detail

      • metaLength

        public int metaLength()
        Description copied from interface: ObjectBundle
        Get the metadata length.
        Specified by:
        metaLength in interface ObjectBundle
        Returns:
        length of metadata
      • data

        public java.lang.Object data​(int rnum)
        Get the value of the ith component.
        Parameters:
        rnum - representation number
        Returns:
        value
      • dataLength

        public int dataLength()
        Description copied from interface: ObjectBundle
        Get the number of objects contained.
        Specified by:
        dataLength in interface ObjectBundle
        Returns:
        Number of objects
      • data

        public java.lang.Object data​(int onum,
                                     int rnum)
        Description copied from interface: ObjectBundle
        Access a particular object and representation.
        Specified by:
        data in interface ObjectBundle
        Parameters:
        onum - Object number
        rnum - Representation number
        Returns:
        Contained data
      • assignDBID

        public boolean assignDBID​(int onum,
                                  DBIDVar var)
        Description copied from interface: ObjectBundle
        Assign the object DBID to a variable
        Specified by:
        assignDBID in interface ObjectBundle
        Parameters:
        onum - Object number
        var - Variable
        Returns:
        false if there was no predefined DBID.
      • append

        public void append​(SimpleTypeInformation<?> meta,
                           java.lang.Object data)
        Append a single representation to the object.
        Parameters:
        meta - Meta for the representation
        data - Data to append