
javadoc.com.google.common.collect.ObjectArrays.html Maven / Gradle / Ivy
The newest version!
ObjectArrays (Guava: Google Core Libraries for Java 11.0.1 API)
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
com.google.common.collect
Class ObjectArrays
java.lang.Object
com.google.common.collect.ObjectArrays
@GwtCompatible(emulated=true)
public final class ObjectArrays
- extends Object
Static utility methods pertaining to object arrays.
- Since:
- 2.0 (imported from Google Collections Library)
- Author:
- Kevin Bourrillion
Method Summary | ||
---|---|---|
static
|
concat(T[] array,
T element)
Returns a new array that appends element to array . |
|
static
|
concat(T[] first,
T[] second,
Class<T> type)
Returns a new array that contains the concatenated contents of two arrays. |
|
static
|
concat(T element,
T[] array)
Returns a new array that prepends element to array . |
|
static
|
newArray(Class<T> type,
int length)
Returns a new array of the given length with the specified component type. |
|
static
|
newArray(T[] reference,
int length)
Returns a new array of the given length with the same type as a reference array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
newArray
@GwtIncompatible(value="Array.newInstance(Class, int)") public static <T> T[] newArray(Class<T> type, int length)
- Returns a new array of the given length with the specified component type.
- Parameters:
type
- the component typelength
- the length of the new array
newArray
public static <T> T[] newArray(T[] reference, int length)
- Returns a new array of the given length with the same type as a reference
array.
- Parameters:
reference
- any array of the desired typelength
- the length of the new array
concat
@GwtIncompatible(value="Array.newInstance(Class, int)") public static <T> T[] concat(T[] first, T[] second, Class<T> type)
- Returns a new array that contains the concatenated contents of two arrays.
- Parameters:
first
- the first array of elements to concatenatesecond
- the second array of elements to concatenatetype
- the component type of the returned array
concat
public static <T> T[] concat(@Nullable T element, T[] array)
- Returns a new array that prepends
element
toarray
.- Parameters:
element
- the element to prepend to the front ofarray
array
- the array of elements to append- Returns:
- an array whose size is one larger than
array
, withelement
occupying the first position, and the elements ofarray
occupying the remaining elements.
concat
public static <T> T[] concat(T[] array, @Nullable T element)
- Returns a new array that appends
element
toarray
.- Parameters:
array
- the array of elements to prependelement
- the element to append to the end- Returns:
- an array whose size is one larger than
array
, with the same contents asarray
, pluselement
occupying the last position.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2010-2012. All Rights Reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy