This class is a collection of morphisms. All morphism finding routines
of the
Morphism
class return instances of this class.
The morphisms are stored lazily, that is, they are
constructed when they are needed and they are not stored.
This has two consequences:
-
Loops of the form
for (Morphism m : mc) { ... }
, where
mc
is an instance of MorphismCollection
, are very
memory efficient.
-
Because for methods like
size()
or
contains()
it is needed to
construct all morphisms, these methods are quite time-consuming
relative to normal collections.
If the morphisms are needed at a later stage, it is recommended to store
them in a collection of another type, for example by writing
List<Morphism> morphismList = new ArrayList<Morphism>(mc);
.