xxl.io
Class Buffer

java.lang.Object
  |
  +--xxl.io.Buffer
Direct Known Subclasses:
LRUBuffer

public abstract class Buffer
extends java.lang.Object


Inner Class Summary
protected  class Buffer.Slot
           
 
Field Summary
protected  int fixedSlots
           
protected  java.util.Map owners
           
protected  int size
           
protected  Buffer.Slot[] slots
           
 
Constructor Summary
Buffer(int capacity)
           
 
Method Summary
 boolean contains(java.lang.Object owner, java.lang.Object id)
           
protected  Buffer.Slot fix(java.lang.Object owner, java.lang.Object id, Function obtain)
           
 void flush(java.lang.Object owner, java.lang.Object id)
           
 void flushAll(java.lang.Object owner)
           
 java.lang.Object get(java.lang.Object owner, java.lang.Object id, Function obtain, boolean unfix)
           
 boolean isFixed(java.lang.Object owner, java.lang.Object id)
           
protected  Buffer.Slot lookUp(java.lang.Object owner, java.lang.Object id)
           
protected  Buffer.Slot newSlot(int index)
           
 void remove(java.lang.Object owner, java.lang.Object id)
           
 void removeAll(java.lang.Object owner)
           
protected  int size()
           
 void unfix(java.lang.Object owner, java.lang.Object id)
           
 void update(java.lang.Object owner, java.lang.Object id, java.lang.Object object, Function flush, boolean unfix)
           
protected abstract  Buffer.Slot victim()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fixedSlots

protected int fixedSlots

size

protected int size

slots

protected Buffer.Slot[] slots

owners

protected java.util.Map owners
Constructor Detail

Buffer

public Buffer(int capacity)
Method Detail

victim

protected abstract Buffer.Slot victim()

newSlot

protected Buffer.Slot newSlot(int index)

size

protected int size()

lookUp

protected Buffer.Slot lookUp(java.lang.Object owner,
                             java.lang.Object id)

fix

protected Buffer.Slot fix(java.lang.Object owner,
                          java.lang.Object id,
                          Function obtain)
                   throws java.lang.IllegalStateException

unfix

public void unfix(java.lang.Object owner,
                  java.lang.Object id)

contains

public boolean contains(java.lang.Object owner,
                        java.lang.Object id)

isFixed

public boolean isFixed(java.lang.Object owner,
                       java.lang.Object id)

flush

public void flush(java.lang.Object owner,
                  java.lang.Object id)

flushAll

public void flushAll(java.lang.Object owner)

get

public java.lang.Object get(java.lang.Object owner,
                            java.lang.Object id,
                            Function obtain,
                            boolean unfix)
                     throws java.lang.IllegalStateException

update

public void update(java.lang.Object owner,
                   java.lang.Object id,
                   java.lang.Object object,
                   Function flush,
                   boolean unfix)
            throws java.lang.IllegalStateException

remove

public void remove(java.lang.Object owner,
                   java.lang.Object id)

removeAll

public void removeAll(java.lang.Object owner)