Additional add/remove methods added to Java std::list wrappers

Add functions similar to java.util.LinkedList<E>:
  addFirst
  addLast
  removeFirst
  removeLast
This commit is contained in:
William S Fulton 2017-06-25 00:10:06 +01:00
commit ecebbdd0df
2 changed files with 15 additions and 2 deletions

View file

@ -14,7 +14,6 @@ SWIGINTERN jint SWIG_ListSize(size_t size) {
}
}
%javamethodmodifiers std::list::push_back "private";
%javamethodmodifiers std::list::begin "private";
%javamethodmodifiers std::list::insert "private";
%javamethodmodifiers std::list::doSize "private";
@ -46,7 +45,7 @@ namespace std {
}
public boolean add($typemap(jboxtype, T) value) {
push_back(value);
addLast(value);
return true;
}
@ -173,9 +172,13 @@ namespace std {
%rename(remove) erase;
iterator erase(iterator pos);
size_type max_size() const;
%rename(removeLast) pop_back;
void pop_back();
%rename(removeFirst) pop_front;
void pop_front();
%rename(addLast) push_back;
void push_back(const T &value);
%rename(addFirst) push_front;
void push_front(const T &value);
iterator begin();
iterator end();