Advertisement
bestsss

Untitled

Oct 31st, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. public interface ByteBufferFactory{
  2.   static final ByteBufferFactory instance=FactoryImpl.valueOf(System.getProperty("ByteBufferFactory", "DIRECT"));
  3.   ByteBuffer newInstance(int capacity);
  4. }
  5.  
  6. enum FactoryImpl implments ByteBufferFactory{
  7. DIRECT{
  8.   public ByteBuffer newInstance(capacity){
  9. .....
  10.   }
  11. },
  12.  
  13. HEAP{
  14.  public X newInstance(capacity){
  15. .....
  16.   }
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement