mirror of
https://github.com/corda/corda.git
synced 2025-06-18 23:28:21 +00:00
Tweaked code indentation and formatting to match existing style
This commit is contained in:
@ -15,98 +15,57 @@ package java.util;
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractCollection<T> implements Collection<T> {
|
||||
public boolean add(T element) {
|
||||
throw new UnsupportedOperationException("adding to "
|
||||
+ this.getClass().getName());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.util.Collection#add(java.lang.Object)
|
||||
*/
|
||||
public boolean add(T element) {
|
||||
throw new UnsupportedOperationException("adding to "
|
||||
+ this.getClass().getName());
|
||||
}
|
||||
public boolean addAll(Collection<? extends T> collection) {
|
||||
boolean result = false;
|
||||
for (T obj : collection) {
|
||||
result |= add(obj);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.util.Collection#addAll(java.util.Collection)
|
||||
*/
|
||||
public boolean addAll(Collection<? extends T> collection) {
|
||||
boolean result = false;
|
||||
for (T obj : collection) {
|
||||
result |= add(obj);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException("clear() in "
|
||||
+ this.getClass().getName());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.util.Collection#clear()
|
||||
*/
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException("clear() in "
|
||||
+ this.getClass().getName());
|
||||
}
|
||||
public boolean contains(T element) {
|
||||
if (element != null) {
|
||||
for (Iterator<T> iter = iterator(); iter.hasNext();) {
|
||||
if (element.equals(iter.next())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (Iterator<T> iter = iterator(); iter.hasNext();) {
|
||||
if (iter.next()==null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.util.Collection#contains(java.lang.Object)
|
||||
*/
|
||||
public boolean contains(T element) {
|
||||
if (element != null) {
|
||||
for (Iterator<T> iter = iterator(); iter.hasNext();) {
|
||||
if (element.equals(iter.next())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (Iterator<T> iter = iterator(); iter.hasNext();) {
|
||||
if (iter.next()==null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public boolean isEmpty() {
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.util.Collection#isEmpty()
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
return size() == 0;
|
||||
}
|
||||
public boolean remove(T element) {
|
||||
throw new UnsupportedOperationException("remove(T) in "
|
||||
+ this.getClass().getName());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.util.Collection#remove(java.lang.Object)
|
||||
*/
|
||||
public boolean remove(T element) {
|
||||
throw new UnsupportedOperationException("remove(T) in "
|
||||
+ this.getClass().getName());
|
||||
}
|
||||
public abstract int size();
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.util.Collection#size()
|
||||
*/
|
||||
public abstract int size();
|
||||
public <S> S[] toArray(S[] array) {
|
||||
return Collections.toArray(this, array);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.util.Collection#toArray(S[])
|
||||
*/
|
||||
public <S> S[] toArray(S[] array) {
|
||||
return Collections.toArray(this, array);
|
||||
}
|
||||
|
||||
public abstract Iterator<T> iterator();
|
||||
public abstract Iterator<T> iterator();
|
||||
|
||||
}
|
||||
|
@ -189,51 +189,51 @@ public class Collections {
|
||||
}
|
||||
|
||||
static class UnmodifiableSet<T> implements Set<T> {
|
||||
Set<T> inner;
|
||||
Set<T> inner;
|
||||
|
||||
UnmodifiableSet(Set<T> inner) {
|
||||
this.inner = inner;
|
||||
}
|
||||
|
||||
public boolean add(T element) {
|
||||
throw new UnsupportedOperationException("not supported");
|
||||
}
|
||||
UnmodifiableSet(Set<T> inner) {
|
||||
this.inner = inner;
|
||||
}
|
||||
|
||||
public boolean add(T element) {
|
||||
throw new UnsupportedOperationException("not supported");
|
||||
}
|
||||
|
||||
public boolean addAll(Collection<? extends T> collection) {
|
||||
throw new UnsupportedOperationException("not supported");
|
||||
}
|
||||
public boolean addAll(Collection<? extends T> collection) {
|
||||
throw new UnsupportedOperationException("not supported");
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException("not supported");
|
||||
}
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException("not supported");
|
||||
}
|
||||
|
||||
public boolean contains(T element) {
|
||||
return inner.contains(element);
|
||||
}
|
||||
public boolean contains(T element) {
|
||||
return inner.contains(element);
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return inner.isEmpty();
|
||||
}
|
||||
public boolean isEmpty() {
|
||||
return inner.isEmpty();
|
||||
}
|
||||
|
||||
public Iterator<T> iterator() {
|
||||
return inner.iterator();
|
||||
}
|
||||
public Iterator<T> iterator() {
|
||||
return inner.iterator();
|
||||
}
|
||||
|
||||
public boolean remove(T element) {
|
||||
throw new UnsupportedOperationException("not supported");
|
||||
}
|
||||
public boolean remove(T element) {
|
||||
throw new UnsupportedOperationException("not supported");
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return inner.size();
|
||||
}
|
||||
public int size() {
|
||||
return inner.size();
|
||||
}
|
||||
|
||||
public <S> S[] toArray(S[] array) {
|
||||
return inner.toArray(array);
|
||||
}
|
||||
|
||||
public <S> S[] toArray(S[] array) {
|
||||
return inner.toArray(array);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static <T> Set<T> unmodifiableSet(Set<T> hs) {
|
||||
return new UnmodifiableSet<T>(hs);
|
||||
}
|
||||
public static <T> Set<T> unmodifiableSet(Set<T> hs) {
|
||||
return new UnmodifiableSet<T>(hs);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user