addPosition method

void addPosition(
  1. Position position,
  2. int length
)

Add a new position and change the length.

Implementation

void addPosition(Position position, int length) {
  positions.add(position);
  this.length = length;
}