/* * Android Wheel Control. * https://code.google.com/p/android-wheel/ * * Copyright 2011 Yuri Kanivets * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.demo.example; /** * Range for visible items. */ public class ItemsRange { // First item number private int first; // Items count private int count; /** * Default constructor. Creates an empty range */ public ItemsRange() { this(0, 0); } /** * Constructor * @param first the number of first item * @param count the count of items */ public ItemsRange(int first, int count) { this.first = first; this.count = count; } /** * Gets number of first item * @return the number of the first item */ public int getFirst() { return first; } /** * Gets number of last item * @return the number of last item */ public int getLast() { return getFirst() + getCount() - 1; } /** * Get items count * @return the count of items */ public int getCount() { return count; } /** * Tests whether item is contained by range * @param index the item number * @return true if item is contained */ public boolean contains(int index) { return index >= getFirst() && index <= getLast(); } }
最近下载更多
bobbywei LV1
2020年6月17日
侯绍君 LV1
2018年1月5日
ddman9009 LV25
2016年5月6日
daniel_gjg LV25
2015年10月19日
leehove LV17
2015年3月17日
a990735643 LV1
2015年2月5日
lijie2014 LV1
2014年11月20日
武林 LV3
2014年8月7日