本文整理匯總了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..."); }
*/
}