public SceneProcedure getParent(Type type) { // 没有父节点,返回null if (mParentProcedure == null) { return(null); } // 有父节点,则判断类型是否匹配,匹配则返回父节点 if (mParentProcedure.mType == type) { return(mParentProcedure); } // 不匹配,则继续向上查找 return(mParentProcedure.getParent(type)); }
public SceneProcedure getParent(PROCEDURE_TYPE type) { // 没有父节点,返回null if (mParentProcedure == null) { return(null); } // 有父节点,则判断类型是否匹配,匹配则返回父节点 if (mParentProcedure.getProcedureType() == type) { return(mParentProcedure); } // 不匹配,则继续向上查找 else { return(mParentProcedure.getParent(type)); } }