|
ref_send API 2.17 defensive programming in Java |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.joe_e.array.ConstArray<E>
org.joe_e.array.ImmutableArray<E>
org.joe_e.array.PowerlessArray<java.lang.Short>
org.joe_e.array.ShortArray
public final class ShortArray
An immutable array of short.
| Nested Class Summary | |
|---|---|
static class |
ShortArray.Builder
A ShortArray factory. |
| Method Summary | ||
|---|---|---|
static ShortArray |
array()
Construct an empty ShortArray |
|
static ShortArray |
array(short... shorts)
Constructs an array of shorts. |
|
static ShortArray |
array(short value)
Construct a ShortArray with one element. |
|
static ShortArray |
array(short value1,
short value2)
Construct a ShortArray with two elements. |
|
static ShortArray |
array(short value1,
short value2,
short value3)
Construct a ShortArray with three elements. |
|
static ShortArray |
array(short value1,
short value2,
short value3,
short value4)
Construct a ShortArray with four elements. |
|
static ShortArray.Builder |
builder()
Get a ShortArray.Builder. |
|
static ShortArray.Builder |
builder(int estimate)
Get a ShortArray.Builder. |
|
boolean |
equals(java.lang.Object other)
Test for equality with another object |
|
java.lang.Short |
get(int i)
Creates a Short for a specified short. |
|
short |
getShort(int i)
Gets the short at a specified position. |
|
int |
hashCode()
Computes a digest of the array for hashing. |
|
int |
length()
Gets the length of the array. |
|
|
toArray(T[] prototype)
Return a mutable copy of the array |
|
short[] |
toShortArray()
Creates a mutable copy of the short array |
|
java.lang.String |
toString()
Return a string representation of the array |
|
ShortArray |
with(short newShort)
Creates a ShortArray with an appended short. |
|
ShortArray |
with(java.lang.Short newShort)
Creates a ShortArray |
|
ShortArray |
without(int i)
Return a new ShortArray that contains the same elements
as this one excluding the element at a specified index |
|
| Methods inherited from class org.joe_e.array.PowerlessArray |
|---|
array |
| Methods inherited from class org.joe_e.array.ConstArray |
|---|
iterator |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static ShortArray array(short... shorts)
shorts.
shorts - each elementpublic static ShortArray array()
ShortArray
public static ShortArray array(short value)
ShortArray with one element.
value - the value
public static ShortArray array(short value1,
short value2)
ShortArray with two elements.
value1 - the first valuevalue2 - the second value
public static ShortArray array(short value1,
short value2,
short value3)
ShortArray with three elements.
value1 - the first valuevalue2 - the second valuevalue3 - the third value
public static ShortArray array(short value1,
short value2,
short value3,
short value4)
ShortArray with four elements.
value1 - the first valuevalue2 - the second valuevalue3 - the third valuevalue4 - the fourth valuepublic boolean equals(java.lang.Object other)
equals in class ImmutableArray<java.lang.Short>ConstArray with the same
contents as this arraypublic int hashCode()
Arrays.hashCode(Object[]) called on a Java array
containing the same elements.
hashCode in interface SelflesshashCode in class ConstArray<java.lang.Short>public java.lang.String toString()
toString in class ConstArray<java.lang.Short>public int length()
length in class ConstArray<java.lang.Short>public java.lang.Short get(int i)
Short for a specified short.
get in class ConstArray<java.lang.Short>i - position of the element to return
java.lang.ArrayIndexOutOfBoundsException - i is out of boundspublic <T> T[] toArray(T[] prototype)
toArray in class ConstArray<java.lang.Short>prototype - prototype of the array to copy into
ConstArray
of the same type as prototype
java.lang.ArrayStoreException - if an element cannot be stored in the arraypublic ShortArray with(java.lang.Short newShort)
ShortArray with an appended Short.
- Overrides:
with in class PowerlessArray<java.lang.Short>
- Parameters:
newShort - the element to append
- Returns:
- the new array
- Throws:
java.lang.NullPointerException - newShort is null
public short getShort(int i)
short at a specified position.
i - position of the element to return
java.lang.ArrayIndexOutOfBoundsException - i is out of boundspublic short[] toShortArray()
short array
public ShortArray with(short newShort)
ShortArray with an appended short.
newShort - the element to appendpublic ShortArray without(int i)
ShortArray that contains the same elements
as this one excluding the element at a specified index
without in class PowerlessArray<java.lang.Short>i - the index of the element to exclude
public static ShortArray.Builder builder()
ShortArray.Builder. This is equivalent to the
constructor.
public static ShortArray.Builder builder(int estimate)
ShortArray.Builder. This is equivalent to the
constructor.
estimate - estimated array length
|
ref_send API 2.17 defensive programming in Java |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.