Skip to content

Commit

Permalink
AddAll methods for List/Set
Browse files Browse the repository at this point in the history
  • Loading branch information
li-ukumar committed Jun 25, 2024
1 parent 2d2e6bb commit 04c3ec5
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,30 @@ public boolean addAll(int index, java.util.Collection<? extends String> c) {
return modified;
}

/**
* Overloaded method to add all Utf8 elements of a collection at a specific index.
*/
public boolean addAll(int index, java.util.List<? extends Utf8> c) {
boolean modified = false;
for (Utf8 element : c) {
_utf8List.add(index++, element);
modified = true;
}
return modified;
}

/**
* Overloaded method to add all Utf8 elements of a set at a specific index.
*/
public boolean addAll(int index, java.util.Set<? extends Utf8> c) {
boolean modified = false;
for (Utf8 element : c) {
_utf8List.add(index++, element);
modified = true;
}
return modified;
}

@Override
public boolean remove(Object o) {
return _utf8List.remove(new Utf8(o.toString()));
Expand Down

0 comments on commit 04c3ec5

Please sign in to comment.