/** * Get a Fastutil {@link it.unimi.dsi.fastutil.longs.LongCollection} from a {@link java.util.Collection} of longs. * This method simply casts the collection, if possible, and returns a * wrapper otherwise. * * @param longs A collection of longs. * @return The collection as a {@link it.unimi.dsi.fastutil.longs.LongCollection}. */ public static LongCollection asLongCollection(final Collection<Long> longs) { if (longs instanceof LongCollection) { return (LongCollection) longs; } else { return new LongCollectionWrapper(longs); } }
@Override public boolean remove(long k) { return super.rem(k); }
@Override public long[] toArray(long[] a) { return toLongArray(a); }
@Override public long[] toArray(long[] a) { return toLongArray(a); }
@Override public boolean remove(long k) { return super.rem(k); }
/** * Get a Fastutil {@link it.unimi.dsi.fastutil.longs.LongCollection} from a {@link java.util.Collection} of longs. * This method simply casts the collection, if possible, and returns a * wrapper otherwise. * * @param longs A collection of longs. * @return The collection as a {@link it.unimi.dsi.fastutil.longs.LongCollection}. */ public static LongCollection asLongCollection(final Collection<Long> longs) { if (longs instanceof LongCollection) { return (LongCollection) longs; } else { return new LongCollectionWrapper(longs); } }