Package org.intermine.objectstore.query
Class ObjectStoreBag
- java.lang.Object
-
- org.intermine.objectstore.query.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 booleanequals(java.lang.Object o)Override Object#equals.intgetBagId()Returns the identifier of the bag.java.lang.Class<?>getType()Get Java type represented by this item.inthashCode()Override Object#hashCode.
-
-
-
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:
getTypein interfaceQuerySelectable- 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:
equalsin classjava.lang.Object- Parameters:
o- an Object- Returns:
- true if this equals o
-
hashCode
public int hashCode()
Override Object#hashCode. See note in equals.- Overrides:
hashCodein classjava.lang.Object- Returns:
- an int representing the contents
-
-