Start of adding copyable collections. Starting with Lists.
This commit is contained in:
@@ -216,6 +216,9 @@ public class LISTS
|
||||
#endif
|
||||
@Override
|
||||
public int size() { return 1; }
|
||||
|
||||
@Override
|
||||
public SingletonList KEY_GENERIC_TYPE copy() { return new SingletonListBRACES(element); }
|
||||
}
|
||||
|
||||
private static class SynchronizedArrayList KEY_GENERIC_TYPE extends SynchronizedList KEY_GENERIC_TYPE implements IARRAY KEY_GENERIC_TYPE
|
||||
@@ -372,6 +375,9 @@ public class LISTS
|
||||
|
||||
@Override
|
||||
public void size(int size) { synchronized(mutex) { l.size(size); } }
|
||||
|
||||
@Override
|
||||
public LIST KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
||||
}
|
||||
|
||||
private static class UnmodifiableRandomList KEY_GENERIC_TYPE extends UnmodifiableList KEY_GENERIC_TYPE implements RandomAccess
|
||||
@@ -481,6 +487,9 @@ public class LISTS
|
||||
|
||||
@Override
|
||||
public void size(int size) { throw new UnsupportedOperationException(); }
|
||||
|
||||
@Override
|
||||
public LIST KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
||||
}
|
||||
|
||||
private static class EmptyList KEY_GENERIC_TYPE extends COLLECTIONS.EmptyCollection KEY_GENERIC_TYPE implements LIST KEY_GENERIC_TYPE
|
||||
@@ -563,5 +572,8 @@ public class LISTS
|
||||
|
||||
@Override
|
||||
public void size(int size) { throw new UnsupportedOperationException(); }
|
||||
|
||||
@Override
|
||||
public EmptyList KEY_GENERIC_TYPE copy() { return this; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user