Lightweight array-backed focus vector underlying MultiFocus[PSVec]. Three variants so empty and singleton focus vectors don't pay a backing-array allocation:
- PSVec.Empty — shared singleton; Prism / Affine miss branches allocate nothing.
- PSVec.Single — element stored inline (~16 B vs a backing-array view's ~40 B).
- PSVec.Slice — arbitrary
(arr, offset, length)view. slice is a zero-copy pointer update — whatmfAssocPSVec.composeFromrelies on for O(1) per-element reassembly.
Equality is value-based across variants.
Attributes
- Companion
- object
- Source
- PSVec.scala
- Graph
-
- Supertypes
-
trait IterableOnce[B]class Objecttrait Matchableclass Any
- Known subtypes
Members list
Value members
Abstract methods
Indexed access. Unchecked: UB if i < 0 || i >= length.
Read the first element. Unchecked: UB if length == 0.
Attributes
- Source
- PSVec.scala
Zero-copy view [from, until), clamped to this vector's bounds.
Materialise as a fresh Array[Any] (Object[] at runtime) — the erased storage currency of the carrier machinery (ObjArrBuilder, mfAssocPSVec, the schemes fold engine), which has no ClassTag to build typed arrays with. Slice overrides with System.arraycopy (intrinsic) so the common rebuild path in Traversal.pEach's from is one memcpy.
Materialise as a fresh Array[Any] (Object[] at runtime) — the erased storage currency of the carrier machinery (ObjArrBuilder, mfAssocPSVec, the schemes fold engine), which has no ClassTag to build typed arrays with. Slice overrides with System.arraycopy (intrinsic) so the common rebuild path in Traversal.pEach's from is one memcpy.
Attributes
- Source
- PSVec.scala
Concrete methods
Compares the receiver object (this) with the argument object (that) for equivalence.
Compares the receiver object (this) with the argument object (that) for equivalence.
Any implementation of this method should be an equivalence relation:
- It is reflexive: for any instance
xof typeAny,x.equals(x)should returntrue. - It is symmetric: for any instances
xandyof typeAny,x.equals(y)should returntrueif and only ify.equals(x)returnstrue. - It is transitive: for any instances
x,y, andzof typeAnyifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue.
If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).
Value parameters
- that
-
the object to compare against this object for equality.
Attributes
- Returns
-
trueif the receiver object is equivalent to the argument;falseotherwise. - Definition Classes
-
Any
- Source
- PSVec.scala
Calculates a hash code value for the object.
Calculates a hash code value for the object.
The default hashing algorithm is platform dependent.
Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.
Attributes
- Returns
-
the hash code value for this object.
- Definition Classes
-
Any
- Source
- PSVec.scala
Attributes
- Source
- PSVec.scala
Index-walking iterator — the IterableOnce bridge (and what makes a PSVec acceptable anywhere a collection is). Hot paths stay on the index loops.
Index-walking iterator — the IterableOnce bridge (and what makes a PSVec acceptable anywhere a collection is). Hot paths stay on the index loops.
Deliberately hand-rolled, NOT Iterator.tabulate(length)(apply) — BY MEASUREMENT (2026-07-22, -prof gc): the tabulate version regressed JsoniterBench.jReadId 48 → 72 B/op (+50%) — its lambda-capturing shape perturbs inlining enough to un-elide the generic foldMap closure in forks that merely LOAD this class. Do not re-simplify without re-measuring that bench.
Attributes
- Source
- PSVec.scala
The number of elements in this $coll, if it can be cheaply computed, -1 otherwise. Cheaply usually means: Not requiring a collection traversal.
The number of elements in this $coll, if it can be cheaply computed, -1 otherwise. Cheaply usually means: Not requiring a collection traversal.
Attributes
- Definition Classes
-
IterableOnce
- Source
- PSVec.scala
Materialise as a List — the read-side bridge for Plated.children / universe and the carriers (circe / avro) that reconstruct from an ordered sequence.
Materialise as a List — the read-side bridge for Plated.children / universe and the carriers (circe / avro) that reconstruct from an ordered sequence.
Attributes
- Source
- PSVec.scala
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Any
- Source
- PSVec.scala
Like toAnyArray but MAY share the backing array zero-copy when a dense Slice covers its full range. Callers MUST treat the result as immutable. Used by consumers that also won't mutate, e.g. optics.Traversal.pEach's from → ArraySeq.unsafeWrapArray). Default is the safe copy; only Slice overrides to share.
Like toAnyArray but MAY share the backing array zero-copy when a dense Slice covers its full range. Callers MUST treat the result as immutable. Used by consumers that also won't mutate, e.g. optics.Traversal.pEach's from → ArraySeq.unsafeWrapArray). Default is the safe copy; only Slice overrides to share.
Attributes
- Source
- PSVec.scala
Inherited methods
Returns a scala.collection.Stepper for the elements of this collection.
Returns a scala.collection.Stepper for the elements of this collection.
The Stepper enables creating a Java stream to operate on the collection, see scala.jdk.StreamConverters. For collections holding primitive values, the Stepper can be used as an iterator which doesn't box the elements.
The implicit scala.collection.StepperShape parameter defines the resulting Stepper type according to the element type of this collection.
- For collections of
Int,Short,ByteorChar, an scala.collection.IntStepper is returned - For collections of
DoubleorFloat, a scala.collection.DoubleStepper is returned - For collections of
Longa scala.collection.LongStepper is returned - For any other element type, an scala.collection.AnyStepper is returned
Note that this method is overridden in subclasses and the return type is refined to S with EfficientSplit, for example scala.collection.IndexedSeqOps.stepper. For Steppers marked with scala.collection.Stepper.EfficientSplit, the converters in scala.jdk.StreamConverters allow creating parallel streams, whereas bare Steppers can be converted only to sequential streams.
Attributes
- Inherited from:
- IterableOnce
- Source
- IterableOnce.scala