| 906 | } |
| 907 | |
| 908 | static class SynchronizedSortedSet<E> extends SynchronizedSet<E> implements |
| 909 | SortedSet<E> { |
| 910 | private static final long serialVersionUID = 8695801310862127406L; |
| 911 | |
| 912 | private final SortedSet<E> ss; |
| 913 | |
| 914 | SynchronizedSortedSet(SortedSet<E> set) { |
| 915 | super(set); |
| 916 | ss = set; |
| 917 | } |
| 918 | |
| 919 | SynchronizedSortedSet(SortedSet<E> set, Object mutex) { |
| 920 | super(set, mutex); |
| 921 | ss = set; |
| 922 | } |
| 923 | |
| 924 | public Comparator<? super E> comparator() { |
| 925 | synchronized (mutex) { |
| 926 | return ss.comparator(); |
| 927 | } |
| 928 | } |
| 929 | |
| 930 | public E first() { |
| 931 | synchronized (mutex) { |
| 932 | return ss.first(); |
| 933 | } |
| 934 | } |
| 935 | |
| 936 | public SortedSet<E> headSet(E end) { |
| 937 | synchronized (mutex) { |
| 938 | return new SynchronizedSortedSet<E>(ss.headSet(end), mutex); |
| 939 | } |
| 940 | } |
| 941 | |
| 942 | public E last() { |
| 943 | synchronized (mutex) { |
| 944 | return ss.last(); |
| 945 | } |
| 946 | } |
| 947 | |
| 948 | public SortedSet<E> subSet(E start, E end) { |
| 949 | synchronized (mutex) { |
| 950 | return new SynchronizedSortedSet<E>(ss.subSet(start, end), |
| 951 | mutex); |
| 952 | } |
| 953 | } |
| 954 | |
| 955 | public SortedSet<E> tailSet(E start) { |
| 956 | synchronized (mutex) { |
| 957 | return new SynchronizedSortedSet<E>(ss.tailSet(start), mutex); |
| 958 | } |
| 959 | } |
| 960 | |
| 961 | // private void writeObject(ObjectOutputStream stream) throws IOException { |
| 962 | // synchronized (mutex) { |
| 963 | // stream.defaultWriteObject(); |
| 964 | // } |
| 965 | // } |
nothing calls this directly
no outgoing calls
no test coverage detected