Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

51
LINES

< > BotCompany Repo | #1011344 // Collection to List Notification Methods (Include)

JavaX fragment (include)

  public boolean equals(Object o) {
      if (this == o)
          return true;
      synchronized (this) {return list.equals(o);}
  }
  public int hashCode() {
      synchronized (this) {return list.hashCode();}
  }

  public E get(int index) {
      synchronized (this) {return list.get(index);}
  }
  public E set(int index, E element) {
      synchronized (this) {return list.set(index, element);}
  }
  public void add(int index, E element) {
      synchronized (this) {list.add(index, element);} change();
  }
  public E remove(int index) {
    E e;
    synchronized (this) { e = list.remove(index); }
    change();
    ret e;
  }

  public int indexOf(Object o) {
      synchronized (this) {return list.indexOf(o);}
  }
  public int lastIndexOf(Object o) {
      synchronized (this) {return list.lastIndexOf(o);}
  }

  public boolean addAll(int index, Collection<? extends E> c) {
      synchronized (this) {if (!list.addAll(index, c)) false;} change(); true;
  }

  public ListIterator<E> listIterator() {
      return list.listIterator(); // doesn't implement all methods
  }

  public ListIterator<E> listIterator(int index) {
      return list.listIterator(index); // doesn't implement all methods
  }

  /*public void replaceAll(UnaryOperator<E> operator) {
      synchronized (this) {list.replaceAll(operator);}
  }*/
  
  public void sort(Comparator<? super E> c) {
      synchronized (this) {list.sort(c);} change();
  }

Author comment

Began life as a copy of #1009406

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1011344
Snippet name: Collection to List Notification Methods (Include)
Eternal ID of this version: #1011344/3
Text MD5: 6ac978716d72f8c8bf112e5d622d911e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-25 21:29:31
Source code size: 1486 bytes / 51 lines
Pitched / IR pitched: No / No
Views / Downloads: 405 / 922
Version history: 2 change(s)
Referenced in: [show references]