获取请求URL最后的一个/后面的部分的int值   <br>
例如请求URL /pipes/record/query/2   <br>
获取type参数: int type = request.getRequstURILastPath(0); //type = 2

@param defvalue 默认int值

@return int值
962524
public int getRequstURILastPath(int defvalue) {
        String val = getRequstURILastPath();
        try {
            return val.isEmpty() ? defvalue : Integer.parseInt(val);
        } catch (NumberFormatException e) {
            return defvalue;
        }
    }
1194415
public short getRequstURIPath(String prefix, short defvalue) {
        String val = getRequstURIPath(prefix, null);
        try {
            return val == null ? defvalue : Short.parseShort(val);
        } catch (NumberFormatException e) {
            return defvalue;
        }
    }
197642
public static String getForwardURI(HttpServletRequest request) {
        String result = (String) request.getAttribute(WebUtils.FORWARD_REQUEST_URI_ATTRIBUTE);
        if (GrailsStringUtils.isBlank(result)) result = request.getRequestURI();
        return result;
    }
1156976
@Override
  public Long getValue(int pollerIndex) {
    final long n = getCount(pollerIndex);
    return n > 0 ? totalMeasurement.getValue(pollerIndex).longValue() / n : 0L;
  }
72925
public final QueryParser.f_return f() throws RecognitionException {
        QueryParser.f_return retval = new QueryParser.f_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token string_literal85=null;

        CommonTree string_literal85_tree=null;

        try {
            // src/riemann/Query.g:72:3: ( 'false' )
            // src/riemann/Query.g:72:5: 'false'
            {
            root_0 = (CommonTree)adaptor.nil();

            string_literal85=(Token)match(input,28,FOLLOW_28_in_f559); 
            string_literal85_tree = (CommonTree)adaptor.create(string_literal85);
            adaptor.addChild(root_0, string_literal85_tree);


            }

            retval.stop = input.LT(-1);

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
553089
public double getNumber(String nameOfField, double defaultValue) {
		Double value = ((Double)numericData.get(nameOfField));
		
		if (value == null) {
			return defaultValue;
		}
		
		return value.doubleValue();
	}
1261726
public static int getIntSelector(SlingHttpServletRequest request, int defaultValue) {
        String[] selectors = request.getRequestPathInfo().getSelectors();
        for (String selector : selectors) {
            try {
                return Integer.parseInt(selector);
            } catch (NumberFormatException nfex) {
                // ok, try next
            }
        }
        return defaultValue;
    }
131871
private Integer getChildCount(Value value)
	{
		// all types listed here are directly toString() in the debugger
		if (value instanceof NumericValue || value instanceof CharacterValue
				|| value instanceof NilValue || value instanceof TokenValue)
		{
			return 0;
		} else if (value instanceof SetValue)
		{
			return ((SetValue) value).values.size();
		} else if (value instanceof SeqValue)
		{
			boolean isString = true;
			for (Value v : ((SeqValue) value).values)
			{
				if (!(deref(v) instanceof CharacterValue))
				{
					isString = false;
				}
			}

			if (isString)
			{
				return 0; // tread as simple value
			} else
			{
				return ((SeqValue) value).values.size();
			}

		} else if (value instanceof MapValue)
		{
			return ((MapValue) value).values.size();
		} else if (value instanceof ObjectValue)
		{
			int count = 0;
			for (NameValuePair v : ((ObjectValue) value).members.asList())
			{
				if (isDebugVisible(v.value))
				{
					count++;
				}
			}
			return count;

		} else if (value instanceof UpdatableValue
				|| value instanceof TransactionValue
				|| value instanceof ReferenceValue)
		{
			return getChildCount(deref(value));
		} else if (value instanceof RecordValue)
		{
			RecordValue rVal = (RecordValue) value;
			return rVal.fieldmap.size();
		} else if (value instanceof TupleValue)
		{
			TupleValue tVal = (TupleValue) value;
			return tVal.values.size();
		}

		return 0;
	}
432929
@Override
    public <T> T getParameterValue(Parameter<T> arg0)
    {

        return query.getParameterValue(arg0);
    }
160805
@Override
    public double getValueAt(final int at) {
        if (userRecallAtCutoff.containsKey(at)) {
            int n = 0;
            double rec = 0.0;
            for (U u : userRecallAtCutoff.get(at).keySet()) {
                double urec = getValueAt(u, at);
                if (!Double.isNaN(urec)) {
                    rec += urec;
                    n++;
                }
            }
            if (n == 0) {
                rec = 0.0;
            } else {
                rec = rec / n;
            }
            return rec;
        }
        return Double.NaN;
    }
403325
synchronized public long getValue() {

        if (limitReached) {
            throw Error.error(ErrorCode.X_2200H);
        }

        long nextValue;

        if (increment > 0) {
            if (currValue > maxValue - increment) {
                if (isCycle) {
                    nextValue = minValue;
                } else {
                    limitReached = true;
                    nextValue    = minValue;
                }
            } else {
                nextValue = currValue + increment;
            }
        } else {
            if (currValue < minValue - increment) {
                if (isCycle) {
                    nextValue = maxValue;
                } else {
                    limitReached = true;
                    nextValue    = minValue;
                }
            } else {
                nextValue = currValue + increment;
            }
        }

        long result = currValue;

        currValue = nextValue;

        return result;
    }
1276446
public long getRequstURILastPath(long defvalue) {
        String val = getRequstURILastPath();
        try {
            return val.isEmpty() ? defvalue : Long.parseLong(val);
        } catch (NumberFormatException e) {
            return defvalue;
        }
    }
1227492
public static String getFstPdate(Map data, String defValue) {
        ArrayList<HashMap<String, String>> events = getBucket(data, "management").getDataList();
        Event event = new Event(events, "planting");
        return getValueOr(event.getCurrentEvent(), "date", defValue);
    }
577132
public int getInteger() throws IOException {
        if (tag != tag_Integer) {
            throw new IOException("DerValue.getInteger, not an int " + tag);
        }
        return buffer.getInteger(data.available());
    }
1058963
public String calculateActionPathByJspPath(String requestPath) { // only for JSP
        final String lastPathElement = substringLastRear(requestPath, URL_DELIMITER);
        if (!lastPathElement.contains(".")) { // no JSP
            return requestPath;
        }
        // basically JSP here
        final String frontPathElement = substringLastFront(requestPath, URL_DELIMITER);
        final String fileNameNoExt = substringLastFront(lastPathElement, ".");
        final String pathBase = frontPathElement + URL_DELIMITER;
        if (!fileNameNoExt.contains("_")) { // e.g. list.jsp
            return pathBase; // e.g. /member/ (submit name is needed in this case)
        }
        // the file name has package prefix here
        // e.g. /member/member_list.jsp or /member/list/member_purchase_list.jsp
        final List<String> wordList = splitList(fileNameNoExt, "_"); // e.g. [member, list] or [member, purchase, list]
        if (wordList.size() < 2) { // no way (just in case)
            return pathBase;
        }
        final String firstHit = resolveJspActionPath(requestPath, frontPathElement, pathBase, wordList);
        if (firstHit != null) {
            return firstHit; // e.g. /member/list/ (from /member/member_list.jsp)
        }
        final List<String> retryList = prepareHtmlRetryWordList(requestPath, wordList);
        if (retryList != null && !retryList.isEmpty()) { // e.g. [member, list] (from sp_member_list.jsp)
            final String retryHit = resolveJspActionPath(requestPath, frontPathElement, pathBase, retryList);
            if (retryHit != null) {
                return retryHit; // e.g. /member/list/ (from /member/sp_member_list.jsp)
            }
        }
        // e.g. /member/purchase_list.jsp
        return pathBase; // e.g. /member/ (submit name is needed in this case)
    }
209361
private static List<Integer> parseRange(String value, int step, ValueParser parser) {
		final List<Integer> results = new ArrayList<>();
		
		// 全部匹配形式
		if (value.length() <= 2) {
			//根据步进的第一个数字确定起始时间，类似于 12/3则从12（秒、分等）开始
			int minValue = parser.getMin();
			if(false == isMatchAllStr(value)) {
				minValue = Math.max(minValue, parser.parse(value));
			}else {
				//在全匹配模式下，如果步进不存在，表示步进为1
				if(step < 1) {
					step = 1;
				}
			}
			if(step > 0) {
				final int maxValue = parser.getMax();
				if(minValue > maxValue) {
					throw new CronException("Invalid value {} > {}", minValue, maxValue);
				}
				//有步进
				for (int i = minValue; i <= maxValue; i+=step) {
					results.add(i);
				}
			} else {
				//固定时间
				results.add(minValue);
			}
			return results;
		}

		//Range模式
		List<String> parts = StrUtil.split(value, '-');
		int size = parts.size();
		if (size == 1) {// 普通值
			final int v1 = parser.parse(value);
			if(step > 0) {//类似 20/2的形式
				NumberUtil.appendRange(v1, parser.getMax(), step, results);
			}else {
				results.add(v1);
			}
		} else if (size == 2) {// range值
			final int v1 = parser.parse(parts.get(0));
			final int v2 = parser.parse(parts.get(1));
			if(step < 1) {
				//在range模式下，如果步进不存在，表示步进为1
				step = 1;
			}
			if (v1 < v2) {// 正常范围，例如：2-5
				NumberUtil.appendRange(v1, v2, step, results);
			} else if (v1 > v2) {// 逆向范围，反选模式，例如：5-2
				NumberUtil.appendRange(v1, parser.getMax(), step, results);
				NumberUtil.appendRange(parser.getMin(), v2, step, results);
			} else {// v1 == v2，此时与单值模式一致
				if(step > 0) {//类似 20/2的形式
					NumberUtil.appendRange(v1, parser.getMax(), step, results);
				}else {
					results.add(v1);
				}
			}
		} else {
			throw new CronException("Invalid syntax of field: [{}]", value);
		}
		return results;
	}
995585
private int getIntValue(int stackDepth, int defaultValue) {
        if (stack.getStackDepth() < stackDepth) {
            return defaultValue;
        }
        OpcodeStack.Item it = stack.getStackItem(stackDepth);
        Object value = it.getConstant();
        if (!(value instanceof Integer)) {
            return defaultValue;
        }
        return ((Number) value).intValue();
    }