Class RandomCollectionWithAddCriteria<T>
- Type Parameters:
T- type of the pair
- All Implemented Interfaces:
UpdatableMarks
- Direct Known Subclasses:
MarkPairCollection
RandomCollection that uses AddCriteria to determine which
marks to add.
This class is not a valid bean on its own, as it lacks a default public constructor. To use it in BeanXML, it must be subclassed with such a constructor. However, it is a valid (non-bean) class on its own.
The class is kept non-abstract to allow instantiation when copy methods (shallowCopy, deepCopy, etc.) are called.
-
Constructor Summary
ConstructorsConstructorDescriptionRandomCollectionWithAddCriteria(Class<?> pairTypeClass) Creates a new instance with the specified pair type class. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(MemoForIndex marksExisting, VoxelizedMarkMemo newMark) booleancontainsMark(Mark mark) Checks if the collection contains a specific mark.Creates a set of unique pairs from the graph.deepCopy()Creates a deep copy of this RandomCollectionWithAddCriteria.voidexchange(MemoForIndex memo, VoxelizedMarkMemo oldMark, int indexOldMark, VoxelizedMarkMemo newMark) The criteria used to determine which marks to add.getMarks()Gets all marks in the collection.getPairsFor(Mark mark) Gets all pairs associated with a specific mark.Class<?> The class type of the pair.voidinitUpdatableMarks(MemoForIndex marks, EnergyStack stack, Logger logger, SharedFeatures sharedFeatures) booleanisMarksSpan(MarkCollection marks) Checks if the givenMarkCollectionspans all marks in this collection.voidremove(MemoForIndex marksExisting, VoxelizedMarkMemo mark) sampleRandomPairNonUniform(RandomNumberGenerator randomNumberGenerator) voidsetAddCriteria(AddCriteria<T> addCriteria) The criteria used to determine which marks to add.voidsetPairTypeClass(Class<?> pairTypeClass) The class type of the pair.Creates a shallow copy of this RandomCollectionWithAddCriteria.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
RandomCollectionWithAddCriteria
Creates a new instance with the specified pair type class.- Parameters:
pairTypeClass- the class type of the pair
-
-
Method Details
-
shallowCopy
Creates a shallow copy of this RandomCollectionWithAddCriteria.This method creates a new instance with the same pairTypeClass and addCriteria, and copies references to the graph, energyStack, logger, and sharedFeatures.
- Returns:
- a new RandomCollectionWithAddCriteria instance with shallow-copied properties
-
deepCopy
Creates a deep copy of this RandomCollectionWithAddCriteria.This method creates a new instance with the same pairTypeClass and addCriteria, and copies references to the graph, energyStack, logger, and sharedFeatures.
- Returns:
- a new RandomCollectionWithAddCriteria instance with deep-copied properties
-
add
public void add(MemoForIndex marksExisting, VoxelizedMarkMemo newMark) throws UpdateMarkSetException - Throws:
UpdateMarkSetException
-
exchange
public void exchange(MemoForIndex memo, VoxelizedMarkMemo oldMark, int indexOldMark, VoxelizedMarkMemo newMark) throws UpdateMarkSetException - Throws:
UpdateMarkSetException
-
remove
public void remove(MemoForIndex marksExisting, VoxelizedMarkMemo mark) throws UpdateMarkSetException - Throws:
UpdateMarkSetException
-
createPairsUnique
-
getPairsFor
Gets all pairs associated with a specific mark.- Parameters:
mark- theMarkto get pairs for- Returns:
- a
Collectionof edges (pairs) associated with the mark
-
containsMark
-
getMarks
Gets all marks in the collection.- Returns:
- a
Collectionof allMarks in the graph
-
isMarksSpan
Checks if the givenMarkCollectionspans all marks in this collection.This method verifies that all marks in the given collection are present in this collection, and that this collection doesn't contain any additional marks.
- Parameters:
marks- theMarkCollectionto check against- Returns:
- true if the given collection spans all marks in this collection, false otherwise
-
sampleRandomPairNonUniform
- Specified by:
sampleRandomPairNonUniformin classRandomCollection<T>
-
getPairTypeClass
The class type of the pair. -
setPairTypeClass
The class type of the pair. -
getAddCriteria
The criteria used to determine which marks to add. -
setAddCriteria
The criteria used to determine which marks to add.
-