This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LinkedList<T> implements Iterable<T> | |
{ | |
public LinkedNode<T> head = new LinkedNode<T>( this ); | |
private int size = 0; | |
public final LinkedNode<T> add( T value ) | |
{ | |
return new LinkedNode<T>( value ).prepend( head ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Prime | |
{ | |
/* BEGIN TEST */ | |
public static void main( String[] args ) | |
{ | |
Prime p = new Prime( 100000 ); | |
// Load 100,000 primes into cache | |
long t0 = System.nanoTime(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class Blend | |
{ | |
public static final Blend Alpha = new Blend() | |
{ | |
public int blend( int o, int n ) | |
{ | |
return Color.mixRGB( o, n, Color.alpha( n ), Color.alpha( o ) ); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Reflect<T> | |
{ | |
public T get(ByteBuffer in); | |
public void getAndSet(ByteBuffer in, Object obj, Field field) throws IllegalAccessException; | |
public void put(ByteBuffer out, T v); | |
public int sizeOf(T v); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.nio.ByteBuffer; | |
public class Compress | |
{ | |
public static final int BYTE_MORE = 0x80; | |
public static final int BYTE_SIGN = 0x40; | |
public static final int BYTE_NULL = 0x20; |
NewerOlder