Skip to content

Column indexOf method #786

@r8vnhill

Description

@r8vnhill

I was trying to get the first index that matched a certain value (like Java List's indexOf method) and I couldn't find anything like that in the column's implementation.

Is that functionality not implemented?

For now I'm transforming the column into a List to use the method, but I think it's too much work for something that shouldn't be so complicated.

If it's actually a missing feature I think that the same implementation as Java Lists would work:

public int indexOf(Object o) {
  Objects.requireNonNull(o);
  for (int i = 0, s = size(); i < s; i++) {
    if (o.equals(get(i)) {
      return i;
    }
  }
  return -1;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions