Encodes the coded index into its compressed integer representation.
@override int encode() => ((value.index + 1) << 1) | 1;