Javolution 6.0.0 java
|
Classes | |
class | Decimal |
Public Member Functions | |
int | compareTo (Index that) |
int | compareTo (int value) |
Index | copy () |
double | doubleValue () |
boolean | equals (Object obj) |
float | floatValue () |
int | hashCode () |
int | intValue () |
boolean | isZero () |
long | longValue () |
Index | next () |
Index | previous () |
String | toString () |
Index | value () |
Static Public Member Functions | |
static Index | valueOf (int value) |
Static Public Attributes | |
static final Configurable< Integer > | UNIQUE |
static final Index | ZERO = new Index(0) |
Protected Member Functions | |
final Object | readResolve () throws ObjectStreamException |
Static Package Functions | |
[static initializer] | |
Private Member Functions | |
Index (int value) | |
Private Attributes | |
final int | value |
Static Private Attributes | |
static final long | serialVersionUID = 0x600L |
static final Index[] | INSTANCES = new Index[UNIQUE.get()] |
A non-negative number representing a position in an arrangement. For example: [code] class SparseVector<F> { FastMap<Index, F> elements = new FastMap<Index, F>(); ... }[/code]
Index performance is on-par with the primitive
type for small values and similar to Integer instances for large values. Small indexes have no adverse effect on the garbage collector and have fast equals method due to their unicity.
Definition at line 43 of file Index.java.
|
private |
Creates an index having the specified value.
Definition at line 123 of file Index.java.
|
staticpackage |
int javolution.util.Index.compareTo | ( | Index | that | ) |
Compares this index with the specified index for order. Returns a negative integer, zero, or a positive integer as this index is less than, equal to, or greater than the specified index.
that | the index to be compared. |
Definition at line 136 of file Index.java.
References javolution.util.Index.value.
int javolution.util.Index.compareTo | ( | int | value | ) |
Compares this index with the specified integer value for order. Returns a negative integer, zero, or a positive integer as this index is less than, equal to, or greater than the specified value.
value | the value to be compared. |
Definition at line 149 of file Index.java.
Index javolution.util.Index.copy | ( | ) |
double javolution.util.Index.doubleValue | ( | ) |
Returns the index value as double
.
Definition at line 166 of file Index.java.
boolean javolution.util.Index.equals | ( | Object | obj | ) |
float javolution.util.Index.floatValue | ( | ) |
Returns the index value as float
.
Definition at line 186 of file Index.java.
int javolution.util.Index.hashCode | ( | ) |
Returns the hash code for this index.
Definition at line 194 of file Index.java.
int javolution.util.Index.intValue | ( | ) |
Returns the index value as int
.
Definition at line 203 of file Index.java.
Referenced by javolution.util.internal.bitset.BitSetServiceImpl.add().
boolean javolution.util.Index.isZero | ( | ) |
long javolution.util.Index.longValue | ( | ) |
Index javolution.util.Index.next | ( | ) |
Returns the index after this one.
Definition at line 228 of file Index.java.
References javolution.util.Index.valueOf().
Index javolution.util.Index.previous | ( | ) |
Returns the index before this one.
IndexOutOfBoundsException | if (this == Index.ZERO) |
Definition at line 237 of file Index.java.
References javolution.util.Index.valueOf().
|
protected |
Ensures index unicity during deserialization.
Definition at line 244 of file Index.java.
References javolution.util.Index.valueOf().
String javolution.util.Index.toString | ( | ) |
Returns the String representation of this index.
Definition at line 254 of file Index.java.
References javolution.text.TextContext.getFormat().
Index javolution.util.Index.value | ( | ) |
|
static |
Returns the index for the specified
non-negative value (returns a preallocated instance if the specified value is small).
value | the index value. |
IndexOutOfBoundsException | if value < 0 |
Definition at line 111 of file Index.java.
Referenced by javolution.util.internal.bitset.BitSetIteratorImpl.next(), javolution.util.Index.next(), javolution.util.Index.Decimal.parse(), javolution.util.Index.previous(), javolution.util.Index.readResolve(), and javolution.xml.XMLReferenceResolver.writeReference().
Definition at line 94 of file Index.java.
|
staticprivate |
Definition at line 93 of file Index.java.
|
static |
Holds the number of unique preallocated instances (default
). This number is configurable, for example with
there is no unique instance.
Definition at line 69 of file Index.java.
|
private |
Holds the index value.
Definition at line 118 of file Index.java.
Referenced by javolution.util.Index.compareTo().
Holds the index zero (value 0
).
Definition at line 91 of file Index.java.