public class MemoryLimitedList<T> extends Object implements AppendList<T>
Only two stages support in such kind of list. The first one is WRITE, the next is read. So far random WRITE and READ are not supported in this list.
If current size is over limited size, a GuaguaRuntimeException is added when #add(Object).
AppendList.State| Constructor and Description |
|---|
MemoryLimitedList(List<T> delegationList)
Constructor with delegation list
|
MemoryLimitedList(long maxSize,
List<T> delegationList)
Constructor with max bytes size limit and delegation list.
|
public MemoryLimitedList(long maxSize,
List<T> delegationList)
public boolean append(T t)
AppendListappend in interface AppendList<T>t - the object to appendpublic void switchState()
AppendListswitchState in interface AppendList<T>public int size()
AppendListsize in interface AppendList<T>public void clear()
AppendListclear in interface AppendList<T>Copyright © 2015. All Rights Reserved.