Advertisement
Guest User

Untitled

a guest
Feb 12th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1.  
  2. package com.sh_2.mavenproject1;
  3.  
  4. import org.apache.commons.collections.Buffer;
  5. import org.apache.commons.collections.BufferUtils;
  6. import org.apache.commons.collections.buffer.CircularFifoBuffer;
  7.  
  8.  
  9. public class Code{
  10.  
  11. public Code() {
  12. }
  13.  
  14. Buffer fifo = (Buffer) BufferUtils.synchronizedBuffer(new CircularFifoBuffer());
  15.  
  16.  
  17. public String GetString(){
  18.  
  19. String Value = (String) fifo.get();
  20.  
  21. return Value;
  22. }
  23.  
  24. public String InsertString(String Value){
  25.  
  26. fifo.add(Value);
  27. // fifo.remove("3");
  28.  
  29. return "0";
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement