diff options
Diffstat (limited to 'src/library/scalax/collection/generic/SequenceFactory.scala')
-rwxr-xr-x | src/library/scalax/collection/generic/SequenceFactory.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/library/scalax/collection/generic/SequenceFactory.scala b/src/library/scalax/collection/generic/SequenceFactory.scala new file mode 100755 index 0000000000..ee97c80c75 --- /dev/null +++ b/src/library/scalax/collection/generic/SequenceFactory.scala @@ -0,0 +1,11 @@ +package scalax.collection.generic + +trait SequenceFactory[CC[A] <: Sequence[A]] extends IterableFactory[CC] { + + /** This method is called in a pattern match { case Sequence(...) => }. + * + * @param x the selector value + * @return sequence wrapped in an option, if this is a Sequence, otherwise none + */ + def unapplySequence[A](x: CC[A]): Some[CC[A]] = Some(x) +} |