Top Description Inners Constructors Methods
org.eclipse.xtext.xbase.lib

public final Class Conversions

extends Object
Class Inheritance
Annotations
@GwtIncompatible:reflection
Imports
java.lang.reflect.Array, java.util.AbstractList, .List, .RandomAccess, com.google.common.annotations.GwtIncompatible, com.google.common.collect.Iterables, com.google.common.primitives.Booleans, .Bytes, .Chars, .Doubles, .Floats, .Ints, .Longs, .Shorts

This is a library used to convert arrays to lists and vice versa in a way that keeps the identity of the to-be-converted object. That is, changes in the array will be reflected by the list and changes to the list will be reflected by the array for both kinds of conversion. The utilities in this class should only be used by the Xbase compiler.
Authors
Sebastian Zarnekow - Initial contribution and API, Sven Efftinge, Facundo Etchezar - Initial implementation of the type-specific primitive array wrappers

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Conversions.WrappedArray<
the type if the list elements.
T
>

A list that is completely backed by an array and that provides access to that array.

public static class
Conversions.WrappedBooleanArray

A list that is completely backed by an array of primitives and that provides access to that array.

public static class
Conversions.WrappedByteArray

A list that is completely backed by an array of primitives and that provides access to that array.

public static class
Conversions.WrappedCharacterArray

A list that is completely backed by an array of primitives and that provides access to that array.

public static class
Conversions.WrappedDoubleArray

A list that is completely backed by an array of primitives and that provides access to that array.

public static class
Conversions.WrappedFloatArray

A list that is completely backed by an array of primitives and that provides access to that array.

public static class
Conversions.WrappedIntegerArray

A list that is completely backed by an array of primitives and that provides access to that array.

public static class
Conversions.WrappedLongArray

A list that is completely backed by an array of primitives and that provides access to that array.

public static class
Conversions.WrappedShortArray

A list that is completely backed by an array of primitives and that provides access to that array.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static Object

Returns:

the unchanged array.
checkComponentType
(Object
the array to be checked. May not be null.
array
,
Class<?>
the expected component type of the array. May not be null.
expectedComponentType
)

Checks the component type of the given array against the expected component type.

public static Object

Returns:

a list if the given object was an array. Otherwise the unmodified given object. May return null if the object was null.
doWrapArray
(Object
the object to be wrapped. May be null.
object
)

Wraps object in a list if and only if object is an array.

public static Object

Returns:

the previously wrapped array if the given value represents such. Otherwise returns the value unmodified. May return null if the value was null.
unwrapArray
(Object
the object to be unwrapped. May be null.
value
)

Unwraps object to extract the original array if and only if object was previously created by doWrapArray(Object).

public static Object

Returns:

the previously wrapped array if the given value represents such. Otherwise returns the value unmodified. May return null if the value was null.
unwrapArray
(Object
the object to be unwrapped. May be null.
value
,
Class<?>
the expected component type of the array. May not be null.
componentType
)

Unwraps object to extract the original array if and only if object was previously created by doWrapArray(Object).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait