|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttwaver.model.HashList<T>
twaver.model.HashCollection<T>
twaver.model.DataBox<T>
T
- 数据元素类型public class DataBox<T extends Data>
数据容器
Field Summary | |
---|---|
protected HashList<T> |
roots
根层元素集合 |
Fields inherited from class twaver.model.HashList |
---|
dataList, dataMap |
Constructor Summary | |
---|---|
DataBox()
|
Method Summary | |
---|---|
protected boolean |
beforeDataPropertyChange(PropertyChangeEvent event)
元素属性变化事件前 |
protected void |
doAdd(int index,
T data)
|
protected boolean |
doRemove(int id,
T data)
|
boolean |
forEachByBreadthFirst(Action<Data> action)
广度优先遍历 |
boolean |
forEachByDepthFirst(Action<Data> action)
深度优先遍历 |
boolean |
forEachByDepthFirstReverse(Action<Data> action)
深度优先反向遍历 |
IDispatcher<PropertyChangeEvent> |
getDataChangeDispatcher()
|
IDispatcher<ParentChangeEvent> |
getParentChangeDispatcher()
元素父节点变化事件派发器 |
T |
getRandomData()
获取随机元素 |
HashList<T> |
getRoots()
根层元素原始集合 |
IDispatcher<ListEvent<T>> |
getSelectionChangeDispatcher()
|
SelectionModel<T> |
getSelectionModel()
|
protected void |
onAdd(int index,
T data)
添加元素 |
protected void |
onClear()
容器被清空 |
protected void |
onDataPropertyChange(PropertyChangeEvent event)
元素属性变化时回调此函数 |
protected void |
onParentChange(ParentChangeEvent event)
父节点变化事件 |
protected void |
onRemove(T data)
|
java.util.List<T> |
toRoots()
根层元素数组 |
Methods inherited from class twaver.model.HashCollection |
---|
_remove, accept, add, add, clearAll, getFilterDispatcher, getListChangeDispatcher, remove, setIndex, setListener |
Methods inherited from class twaver.model.HashList |
---|
add, add, add, addAll, addLast, clear, contains, contains, containsAll, containsById, forEach, forEach, forEachReverse, getById, getByIndex, getDatas, getLastData, indexOf, isEmpty, iterator, remove, remove, removeAll, removeById, removeByIndex, retainAll, reverseIterator, set, set, size, sort, toArray, toArray, toDatas, toDatas |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface twaver.core.model.IHashCollection |
---|
getListChangeDispatcher |
Methods inherited from interface twaver.core.model.IHashList |
---|
add, add, add, add, clearAll, contains, containsById, forEach, forEachReverse, getById, getByIndex, getDatas, getLastData, indexOf, isEmpty, remove, remove, removeById, reverseIterator, set, set, setIndex, size, toDatas |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Methods inherited from interface twaver.filter.IFilter |
---|
accept |
Methods inherited from interface twaver.event.IHandler |
---|
setListener |
Methods inherited from interface java.util.Collection |
---|
equals, hashCode |
Field Detail |
---|
protected HashList<T extends Data> roots
Constructor Detail |
---|
public DataBox()
Method Detail |
---|
public SelectionModel<T> getSelectionModel()
getSelectionModel
in interface IDataBox<T extends Data>
protected boolean beforeDataPropertyChange(PropertyChangeEvent event)
event
- 事件
protected void onDataPropertyChange(PropertyChangeEvent event)
event
- 元素属性变化事件public IDispatcher<PropertyChangeEvent> getDataChangeDispatcher()
getDataChangeDispatcher
in interface IDataBox<T extends Data>
public IDispatcher<ParentChangeEvent> getParentChangeDispatcher()
public IDispatcher<ListEvent<T>> getSelectionChangeDispatcher()
getSelectionChangeDispatcher
in interface IDataBox<T extends Data>
protected void doAdd(int index, T data)
doAdd
in class HashList<T extends Data>
protected void onAdd(int index, T data)
index
- 序号data
- 元素protected boolean doRemove(int id, T data)
doRemove
in class HashList<T extends Data>
protected void onRemove(T data)
protected void onParentChange(ParentChangeEvent event)
event
- 父节点变化事件protected void onClear()
HashCollection
onClear
in class HashCollection<T extends Data>
public HashList<T> getRoots()
public java.util.List<T> toRoots()
public boolean forEachByDepthFirst(Action<Data> action)
action
- 执行函数,返回false时结束遍历
public boolean forEachByDepthFirstReverse(Action<Data> action)
action
- 执行函数,返回false时结束遍历
public boolean forEachByBreadthFirst(Action<Data> action)
action
- 执行函数,返回false时结束遍历
public T getRandomData()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |