本文整理了Java中android.support.v4.util.LongSparseArray.
方法的一些代码示例,展示了LongSparseArray.
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LongSparseArray.
方法的具体详情如下:
包路径:android.support.v4.util.LongSparseArray
类名称:LongSparseArray
方法名:
[英]Creates a new LongSparseArray containing no mappings.
[中]创建不包含任何映射的新数组。
代码示例来源:origin: facebook/litho
public LayoutStateOutputIdCalculator() {
if (!ComponentsConfiguration.lazilyInitializeLayoutStateOutputIdCalculator) {
mLayoutCurrentSequenceForBaseId = new LongSparseArray<>(8);
mVisibilityCurrentSequenceForBaseId = new LongSparseArray<>(8);
}
}
代码示例来源:origin: facebook/litho
public MountState(LithoView view) {
mIndexToItemMap = new LongSparseArray<>();
mVisibilityIdToItemMap = new LongSparseArray<>();
mCanMountIncrementallyMountItems = new LongSparseArray<>();
mCOntext= view.getComponentContext();
mLithoView = view;
mIsDirty = true;
mTestItemMap = ComponentsConfiguration.isEndToEndTestRun
? new HashMap
: null;
// The mount item representing the top-level LithoView which
// is always automatically mounted.
mRootHostMountItem = ComponentsPools.acquireRootHostMountItem(
HostComponent.create(),
mLithoView,
mLithoView);
}
代码示例来源:origin: googlemaps/android-maps-utils
@Override
public Set extends Cluster
long numCells = (long) Math.ceil(256 * Math.pow(2, zoom) / mGridSize);
SphericalMercatorProjection proj = new SphericalMercatorProjection(numCells);
HashSet
LongSparseArray
synchronized (mItems) {
for (T item : mItems) {
Point p = proj.toPoint(item.getPosition());
long coord = getCoord(numCells, p.x, p.y);
StaticCluster
if (cluster == null) {
cluster = new StaticCluster
sparseArray.put(coord, cluster);
clusters.add(cluster);
}
cluster.add(item);
}
}
return clusters;
}
代码示例来源:origin: googlemaps/android-maps-utils
LongSparseArray
column = new LongSparseArray
buckets.put(xBucket, column);
代码示例来源:origin: facebook/litho
mVisibilityCurrentSequenceForBaseId = new LongSparseArray<>(2);
代码示例来源:origin: facebook/litho
mLayoutCurrentSequenceForBaseId = new LongSparseArray<>(2);
代码示例来源:origin: facebook/litho
private final LongSparseArray
private final ArrayList
private final ArrayList
代码示例来源:origin: youxiaochen/ContactList
/**
* @param adapter the sticky header adapter to use
*/
public StickyHeaderDecoration(StickyHeaderAdapter adapter) {
mAdapter = adapter;
mHeaderCache = new LongSparseArray<>();
}
代码示例来源:origin: xiangzhihong/gpuImage
private LongSparseArray
if( LOG_ENABLED ) {
Log.i( TAG, "readSparseLongArray" );
}
final int N = in.readInt();
if( N <= 0 ) {
return null;
}
LongSparseArray
readSparseLongArrayInternal( array, in, N );
return array;
}
代码示例来源:origin: AEFeinstein/mtg-familiar
public static LongSparseArray
if (null == context) {
return new LongSparseArray<>();
}
Type type = new TypeToken
}.getType();
return (new Gson()).fromJson(
PreferenceManager.getDefaultSharedPreferences(context).getString(context.getString(R.string.key_tcgpGroups), "{}"),
type);
}
代码示例来源:origin: jruesga/timeline-chart-view
private LongSparseArray
final LongSparseArray
synchronized (mLock) {
prevData = mData;
}
if (prevData != null) {
final int size = prevData.size();
final LongSparseArray
= new LongSparseArray<>(Math.max(capacity, size));
for (int i = 0; i
}
return data;
}
return new LongSparseArray<>();
}
代码示例来源:origin: ywwynm/EverythingDone
public BaseThingsAdapter(Context context) {
mInflater = LayoutInflater.from(context);
mDensity = DisplayUtil.getScreenDensity(context);
mCOntext= context;
mCheckListAdapters = new LongSparseArray<>();
mReminderDAO = ReminderDAO.getInstance(context);
mHabitDAO = HabitDAO.getInstance(context);
mImageRequestManager = Glide.with(context);
mCardWidth = DisplayUtil.getThingCardWidth(context);
}
代码示例来源:origin: xiangzhihong/gpuImage
/**
* {@inheritDoc}
*/
@Override
public void setAdapter( ListAdapter adapter ) {
if ( adapter != null ) {
mAdapterHasStableIds = mAdapter.hasStableIds();
if ( mChoiceMode != ListView.CHOICE_MODE_NONE && mAdapterHasStableIds &&
mCheckedIdStates == null ) {
mCheckedIdStates = new LongSparseArray
}
}
if ( mCheckStates != null ) {
mCheckStates.clear();
}
if ( mCheckedIdStates != null ) {
mCheckedIdStates.clear();
}
}
代码示例来源:origin: com.albedinsky.android/database
/**
* Returns data of this cursor wrapper in a sparse array of models mapped to theirs id.
*
* @return Array of models with theirs corresponding data or empty array if this cursor does not
* have any data available.
* @see #asList()
* @see #getCount()
*/
@NonNull
public LongSparseArray
this.assertNotClosedOrThrow();
final int count = getCount();
if (count > 0 && moveToFirst()) {
final LongSparseArray
do {
sparseArray.append(getId(), onGetModel());
} while (moveToNext());
return sparseArray;
}
return new LongSparseArray<>(0);
}
代码示例来源:origin: com.albedinsky.android.support/support-database
/**
* Returns data of this cursor wrapper in a sparse array of models mapped to theirs id.
*
* @return Array of models with theirs corresponding data or empty array if this cursor does not
* have any data available.
* @see #asList()
* @see #getCount()
*/
@NonNull
public LongSparseArray
this.assertNotClosedOrThrow();
final int count = getCount();
if (count > 0 && moveToFirst()) {
final LongSparseArray
do {
sparseArray.append(getId(), onGetModel());
} while (moveToNext());
return sparseArray;
}
return new LongSparseArray<>(0);
}
代码示例来源:origin: wiglenet/wigle-wifi-wardriving
@Override
public Set extends Cluster
long numCells = (long) Math.ceil(256 * Math.pow(2, zoom) / GRID_SIZE);
SphericalMercatorProjection proj = new SphericalMercatorProjection(numCells);
HashSet
LongSparseArray
synchronized (mItems) {
for (T item : mItems) {
Point p = proj.toPoint(item.getPosition());
long coord = getCoord(numCells, p.x, p.y);
StaticCluster
if (cluster == null) {
cluster = new StaticCluster
sparseArray.put(coord, cluster);
clusters.add(cluster);
}
cluster.add(item);
}
}
return clusters;
}
代码示例来源:origin: EthACKdotOrg/orWall
LongSparseArray
for (AppRule app: enabledApps) rulesIndex.put(app.getAppUID(), app);
代码示例来源:origin: xiangzhihong/gpuImage
mCheckedIdStates = new LongSparseArray
代码示例来源:origin: wiglenet/wigle-wifi-wardriving
LongSparseArray
column = new LongSparseArray
buckets.put(xBucket, column);
代码示例来源:origin: jruesga/timeline-chart-view
private void setupViewInEditMode() {
final int[] INDEXES = new int[]{0, 1};
mData = new LongSparseArray<>();
mData.put(1452639600000L, new Pair<>(new double[]{1867263,2262779}, INDEXES));
mData.put(1452726000000L, new Pair<>(new double[]{578273,2871800}, INDEXES));