MCPcopy Create free account
hub / github.com/ReadyTalk/avian / UnmodifiableCollection

Class UnmodifiableCollection

classpath/java/util/Collections.java:715–781  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

713 }
714
715 static class UnmodifiableCollection<T> implements Collection<T> {
716 private final Collection<T> inner;
717
718 UnmodifiableCollection(Collection<T> inner) {
719 this.inner = inner;
720 }
721
722 @Override
723 public Iterator<T> iterator() {
724 return new UnmodifiableIterator<T>(inner.iterator());
725 }
726
727 @Override
728 public int size() {
729 return inner.size();
730 }
731
732 @Override
733 public boolean isEmpty() {
734 return inner.isEmpty();
735 }
736
737 @Override
738 public boolean contains(Object element) {
739 return inner.contains(element);
740 }
741
742 @Override
743 public boolean containsAll(Collection<?> c) {
744 return inner.containsAll(c);
745 }
746
747 @Override
748 public boolean add(T element) {
749 throw new UnsupportedOperationException();
750 }
751
752 @Override
753 public boolean addAll(Collection<? extends T> collection) {
754 throw new UnsupportedOperationException();
755 }
756
757 @Override
758 public boolean remove(Object element) {
759 throw new UnsupportedOperationException();
760 }
761
762 @Override
763 public boolean removeAll(Collection<?> c) {
764 throw new UnsupportedOperationException();
765 }
766
767 @Override
768 public Object[] toArray() {
769 return inner.toArray();
770 }
771
772 @Override

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected