Class ObjectStoreBag

  • All Implemented Interfaces:
    QuerySelectable

    public class ObjectStoreBag
    extends java.lang.Object
    implements QuerySelectable
    Object representing a collection of objects which have been stored in the database. This bag can be used in BagConstraints and QueryClassBag objects in queries.
    Author:
    Matthew Wakeling
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectStoreBag​(int bagId)
      Constructs a new ObjectStoreBag.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      Override Object#equals.
      int getBagId()
      Returns the identifier of the bag.
      java.lang.Class<?> getType()
      Get Java type represented by this item.
      int hashCode()
      Override Object#hashCode.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ObjectStoreBag

        public ObjectStoreBag​(int bagId)
        Constructs a new ObjectStoreBag. This method should only be called from an ObjectStore which can provide a suitable valid bagId. Once the bag has been created, elements can be added to it through the ObjectStoreWriter.
        Parameters:
        bagId - the identifier of the bag
    • Method Detail

      • getBagId

        public int getBagId()
        Returns the identifier of the bag. This number will probably only be of use to the internals of an ObjectStore.
        Returns:
        an int
      • getType

        public java.lang.Class<?> getType()
        Get Java type represented by this item.
        Specified by:
        getType in interface QuerySelectable
        Returns:
        class describing the type
      • equals

        public boolean equals​(java.lang.Object o)
        Override Object#equals. Note that this means that ObjectStoreBag objects for different objectstores with the same ID will be counted as equals. Make sure you don't put ObjectStoreBags from different objectstores in the same collection.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - an Object
        Returns:
        true if this equals o
      • hashCode

        public int hashCode()
        Override Object#hashCode. See note in equals.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        an int representing the contents