本文整理汇总了Java中com.heaven7.java.base.util.SparseArray.remove方法的典型用法代码示例。如果您正苦于以下问题:Java SparseArray.remove方法的具体用法?Java SparseArray.remove怎么用?Java SparseArray.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.heaven7.java.base.util.SparseArray
的用法示例。
在下文中一共展示了SparseArray.remove方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: exit0
import com.heaven7.java.base.util.SparseArray; //导入方法依赖的package包/类
private void exit0(int singleState, boolean byMutex) {
final SparseArray<S> stateMap = getStateMap();
S state = stateMap.get(singleState);
// no cache ? remove from cache
if (!isStateCacheEnabled()) {
stateMap.remove(singleState);
mCachedState &= ~singleState;
} else {
mCachedState |= singleState;
}
final P p = getMerger().merge(state.getStateParameter(), getStateParameter());
state.setStateParameter(p);
state.exit(byMutex ? AbstractState.FLAG_MUTEX : 0);
dispatchStateCallback(ACTION_EXIT, singleState, state, null);
state.onDetach();
}
示例2: dispose
import com.heaven7.java.base.util.SparseArray; //导入方法依赖的package包/类
public void dispose() {
final SparseArray<S> map = getStateMap();
getFlagsInternal(mCurrentStates, sTempFlags);
for(int state : sTempFlags){
final S s = map.get(state);
//TODO should destroy foreground state.?
s.exit(0);
s.onDetach();
s.dispose();
map.remove(state);
// System.out.println("dispose : " + s.toString());
}
sTempFlags.clear();
this.mCurrentStates = 0;
this.mCachedState = 0;
this.mParam = null;
}
示例3: removeForgroundStateFromTeam
import com.heaven7.java.base.util.SparseArray; //导入方法依赖的package包/类
public void removeForgroundStateFromTeam(int states, P teamP){
final int share = mCurrentStates & states;
if(share == 0){
return ;
}
final boolean cacheEnabled = isStateCacheEnabled();
//handle state exit
final SparseArray<S> stateMap = getStateMap();
final List<S> tempList = mCallback.ensureAndGetTempList();
getForegroundStates(share, tempList);
for (S s : tempList) {
s.setTeamParameter(teamP);
s.exit(AbstractState.FLAG_TEAM);
s.clearOnceFlags();
s.onDetach();
//remove state instance if need
if(!cacheEnabled){
stateMap.remove(s.getId());
}
}
tempList.clear();
//handle current state and cache state.
mCurrentStates &= ~ share;
if(cacheEnabled){
mCachedState |= share;
}else{
mCachedState &= ~share;
}
}
示例4: destroyStateCache
import com.heaven7.java.base.util.SparseArray; //导入方法依赖的package包/类
/** destroy state cache without current states. */
public void destroyStateCache() {
if (mCachedState > 0) {
final SparseArray<S> map = getStateMap();
getFlagsInternal(mCachedState, sTempFlags);
for(int state : sTempFlags){
map.remove(state);
// System.out.println("destroy state = " + state);
}
sTempFlags.clear();
mCachedState = 0;
} /*
* else{ System.out.println("no state cache..."); }
*/
}