Package org.intermine.api.bag.operations
Class BagOperation
- java.lang.Object
-
- org.intermine.api.bag.operations.BagOperation
-
- All Implemented Interfaces:
BagProducer
- Direct Known Subclasses:
Intersection
,RelativeComplement
,SymmetricDifference
,Union
public abstract class BagOperation extends java.lang.Object implements BagProducer
- Author:
- Alex
-
-
Constructor Summary
Constructors Constructor Description BagOperation(Model model, Profile profile, java.util.Collection<InterMineBag> bags)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ObjectStoreBagCombination
combineBags()
java.util.Collection<InterMineBag>
getBags()
protected java.util.Collection<ClassDescriptor>
getClasses()
java.util.Map<java.lang.String,java.util.List<FieldDescriptor>>
getClassKeys()
java.lang.String
getNewBagName()
abstract java.lang.String
getNewBagType()
protected abstract int
getOperationCode()
Profile
getProfile()
InterMineBag
operate()
Perform this bag operation.void
setClassKeys(java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classKeys)
void
setNewBagName(java.lang.String name)
-
-
-
Field Detail
-
LOG
protected static final org.apache.log4j.Logger LOG
-
model
protected final Model model
-
-
Constructor Detail
-
BagOperation
public BagOperation(Model model, Profile profile, java.util.Collection<InterMineBag> bags)
- Parameters:
model
- modelprofile
- userprofilebags
- lists
-
-
Method Detail
-
getClasses
protected java.util.Collection<ClassDescriptor> getClasses()
- Returns:
- classes
-
getClassKeys
public java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> getClassKeys()
- Returns:
- class keys
-
setClassKeys
public void setClassKeys(java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classKeys)
- Parameters:
classKeys
- class keys
-
getProfile
public Profile getProfile()
- Returns:
- profile
-
getBags
public java.util.Collection<InterMineBag> getBags()
- Returns:
- lists
-
getNewBagType
public abstract java.lang.String getNewBagType() throws IncompatibleTypes
- Returns:
- new bag type
- Throws:
IncompatibleTypes
- if something goes wrong
-
getOperationCode
protected abstract int getOperationCode()
- Returns:
- op code
-
operate
public InterMineBag operate() throws BagOperationException
Perform this bag operation. Yes I know that this is a "execution in the kingdom of nouns" method, and I apologise for the horror of it all. This operation will run at most once. Subsequent calls to operate will always return the same created list.- Specified by:
operate
in interfaceBagProducer
- Returns:
- The new bag. Guaranteed to not be null.
- Throws:
BagOperationException
- somethings gone wrong
-
combineBags
protected ObjectStoreBagCombination combineBags()
- Returns:
- combined list
-
setNewBagName
public void setNewBagName(java.lang.String name)
- Parameters:
name
- bag name
-
getNewBagName
public java.lang.String getNewBagName() throws BagOperationException
- Returns:
- new list name
- Throws:
BagOperationException
- if error creating bag
-
-