com.google.common.collect.Platform Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of google-collections Show documentation
Show all versions of google-collections Show documentation
Google Collections Library is a suite of new collections and collection-related goodness for Java 5.0
// Copyright 2008 Google Inc. All Rights Reserved.
package com.google.common.collect;
import java.util.List;
/**
* Methods factored out so that they can be emulated differently in GWT.
*
* @author Hayward Chan
*/
class Platform {
/**
* Calls {@link List#subList(int, int)}. Factored out so that it can be
* emulated in GWT.
*
* This method is not supported in GWT yet. See
* GWT issue 1791
*/
static List subList(List list, int fromIndex, int toIndex) {
return list.subList(fromIndex, toIndex);
}
/**
* Calls {@link Class#isInstance(Object)}. Factored out so that it can be
* emulated in GWT.
*
* This method is not supported in GWT yet.
*/
static boolean isInstance(Class> clazz, Object obj) {
return clazz.isInstance(obj);
}
/**
* Clone the given array using {@link Object#clone()}. It is factored out so
* that it can be emulated in GWT.
*/
static T[] clone(T[] array) {
return array.clone();
}
private Platform() {}
}