| 
 | 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.Long>
org.joe_e.array.LongArray
public final class LongArray
An immutable array of long.
| Nested Class Summary | |
|---|---|
| static class | LongArray.BuilderA LongArrayfactory. | 
| Method Summary | ||
|---|---|---|
| static LongArray | array()Construct an empty LongArray | |
| static LongArray | array(long... longs)Constructs an array of longs. | |
| static LongArray | array(long value)Construct a LongArraywith one element. | |
| static LongArray | array(long value1,
           long value2)Construct a LongArraywith two elements. | |
| static LongArray | array(long value1,
           long value2,
           long value3)Construct a LongArraywith three elements. | |
| static LongArray | array(long value1,
           long value2,
           long value3,
           long value4)Construct a LongArraywith four elements. | |
| static LongArray.Builder | builder()Get a LongArray.Builder. | |
| static LongArray.Builder | builder(int estimate)Get a LongArray.Builder. | |
|  boolean | equals(java.lang.Object other)Test for equality with another object | |
|  java.lang.Long | get(int i)Creates a Longfor a specifiedlong. | |
|  long | getLong(int i)Gets the longat 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 | |
|  long[] | toLongArray()Creates a mutable copy of the longarray | |
|  java.lang.String | toString()Return a string representation of the array | |
|  LongArray | with(long newLong)Creates a LongArraywith an appendedlong. | |
|  LongArray | with(java.lang.Long newLong)Creates a LongArray | |
|  LongArray | without(int i)Return a new LongArraythat 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 LongArray array(long... longs)
longs.
longs - each elementpublic static LongArray array()
LongArray
public static LongArray array(long value)
LongArray with one element.
value - the value
public static LongArray array(long value1,
                              long value2)
LongArray with two elements.
value1 - the first valuevalue2 - the second value
public static LongArray array(long value1,
                              long value2,
                              long value3)
LongArray with three elements.
value1 - the first valuevalue2 - the second valuevalue3 - the third value
public static LongArray array(long value1,
                              long value2,
                              long value3,
                              long value4)
LongArray 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.Long>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.Long>public java.lang.String toString()
toString in class ConstArray<java.lang.Long>public int length()
length in class ConstArray<java.lang.Long>public java.lang.Long get(int i)
Long for a specified long.
get in class ConstArray<java.lang.Long>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.Long>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 LongArray with(java.lang.Long newLong)
LongArray with an appended Long.
- 
- Overrides:
- within class- PowerlessArray<java.lang.Long>
 
- 
- Parameters:
- newLong- the element to append
- Returns:
- the new array
- Throws:
- java.lang.NullPointerException-- newLongis null
 
public long getLong(int i)
long at a specified position.
i - position of the element to return
java.lang.ArrayIndexOutOfBoundsException - i is out of boundspublic long[] toLongArray()
long array
public LongArray with(long newLong)
LongArray with an appended long.
newLong - the element to appendpublic LongArray without(int i)
LongArray that contains the same elements
 as this one excluding the element at a specified index
without in class PowerlessArray<java.lang.Long>i - the index of the element to exclude
public static LongArray.Builder builder()
LongArray.Builder.  This is equivalent to the
 constructor.
public static LongArray.Builder builder(int estimate)
LongArray.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.