Keith Devens .com |
Wednesday, December 3, 2008 | ![]() |
| A language that doesn't affect the way you think about programming, is not worth knowing. – Alan Perlis | ||
|
| ← President Bush's speech | Forbidden thoughts about 9/11 → |

Pholser wrote:
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):
Generated in about 0.963s.
(Used 8 db queries)

PrimitiveArrays {
private PrimitiveArrays() {
}
public static List asList( final int[] primitives ) {
return new AbstractList() {
private int[] backingStore = primitives;
public Object get( int index ) {
return new Integer( backingStore[ index ] );
}
public Object set( int index, Object item ) {
Object previousItem = get( index );
backingStore[ index ] = ((Integer) item).intValue();
return previousItem;
}
public int size() {
return backingStore.length;
}
};
}
}