get static method

ItemPosition get(
  1. int index,
  2. int length
)

Implementation

static ItemPosition get(int index, int length) {
  ItemPosition position = ItemPosition.middle;
  if (length == 1) {
    position = ItemPosition.startAndEnd;
  } else if (index == length - 1) {
    position = ItemPosition.end;
  } else if (index == 0) {
    position = ItemPosition.start;
  }
  return position;
}