當前位置: 首頁>>代碼示例>>Java>>正文


Java SparseArray.remove方法代碼示例

本文整理匯總了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();
}
 
開發者ID:LightSun,項目名稱:Mvcs,代碼行數:17,代碼來源:StateGroup.java

示例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;
}
 
開發者ID:LightSun,項目名稱:Mvcs,代碼行數:19,代碼來源:StateGroup.java

示例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;
	}
}
 
開發者ID:LightSun,項目名稱:Mvcs,代碼行數:30,代碼來源:StateGroup.java

示例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..."); }
		 */
}
 
開發者ID:LightSun,項目名稱:Mvcs,代碼行數:16,代碼來源:StateGroup.java


注:本文中的com.heaven7.java.base.util.SparseArray.remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。