Parsing Engine

danbikel.util
Interface MapToPrimitive.Entry<K>

All Superinterfaces:
Map.Entry<K,Object>
All Known Implementing Classes:
AbstractMapToPrimitive.Entry, HashMapDouble.Entry, HashMapInt.Entry, HashMapPrimitive.Entry, HashMapTwoDoubles.Entry, HashMapTwoInts.Entry, Trainer.EventEntry
Enclosing interface:
MapToPrimitive<K>

public static interface MapToPrimitive.Entry<K>
extends Map.Entry<K,Object>

Interface that provides methods for all the possible primitive types that could be associated with keys in a MapToPrimitive map.


Method Summary
 void add(byte addend)
          Increments the byte at index 0 by the specified amount.
 void add(double addend)
          Increments the double at index 0 by the specified amount.
 void add(float addend)
          Increments the float at index 0 by the specified amount.
 void add(int addend)
          Increments the int at index 0 by the specified amount.
 void add(int index, byte addend)
          Increments the byte at the specified index by the specified amount.
 void add(int index, double addend)
          Increments the double at the specified index by the specified amount.
 void add(int index, float addend)
          Increments the float at the specified index by the specified amount.
 void add(int index, int addend)
          Increments the int at the specified index by the specified amount.
 void add(int index, long addend)
          Increments the long at the specified index by the specified amount.
 void add(int index, short addend)
          Increments the short at the specified index by the specified amount.
 void add(long addend)
          Increments the long at index 0 by the specified amount.
 void add(short addend)
          Increments the short at index 0 by the specified amount.
 byte getByteValue()
          Gets the byte value associated with the key contained in this entry.
 byte getByteValue(int index)
          Returns the byte value of the specified index associated with the key in this map entry.
 char getCharValue()
          Gets the char value associated with the key contained in this entry.
 char getCharValue(int index)
          Returns the char value of the specified index associated with the key in this map entry.
 double getDoubleValue()
          Gets the double value associated with the key contained in this entry.
 double getDoubleValue(int index)
          Returns the double value of the specified index associated with the key in this map entry.
 float getFloatValue()
          Gets the float value associated with the key contained in this entry.
 float getFloatValue(int index)
          Returns the float value of the specified index associated with the key in this map entry.
 int getIntValue()
          Gets the int value associated with the key contained in this entry.
 int getIntValue(int index)
          Returns the int value of the specified index associated with the key in this map entry.
 long getLongValue()
          Gets the long value associated with the key contained in this entry.
 long getLongValue(int index)
          Returns the long value of the specified index associated with the key in this map entry.
 short getShortValue()
          Gets the short value associated with the key contained in this entry.
 short getShortValue(int index)
          Returns the short value of the specified index associated with the key in this map entry.
 int numBytes()
          Returns the number of byte values associated with the key in this map entry, or 00 if the implementor does not associate bytes with its key
 int numChars()
          Returns the number of char values associated with the key in this map entry, or 0 if the implementor does not associate chars with its key
 int numDoubles()
          Returns the number of double values associated with the key in this map entry, or 0 if the implementor does not associate doubles with its key
 int numFloats()
          Returns the number of float values associated with the key in this map entry, or 0 if the implementor does not associate floats with its key
 int numInts()
          Returns the number of int values associated with the key in this map entry, or 0 if the implementor does not associate ints with its key
 int numLongs()
          Returns the number of long values associated with the key in this map entry, or 0 if the implementor does not associate longs with its key
 int numShorts()
          Returns the number of short values associated with the key in this map entry, or 0 if the implementor does not associate shorts with its key
 boolean replaceKey(K key)
          Sets the key of this map entry to be the specified key if it is equal to the current key.
 byte set(int index, byte value)
          Sets the char value for the key in this entry to be the specified character.
 char set(int index, char value)
          Sets the char value for the key in this entry to be the specified character.
 double set(int index, double value)
          Sets the char value for the key in this entry to be the specified character.
 float set(int index, float value)
          Sets the float value for the key in this entry to be the specified character.
 int set(int index, int value)
          Sets the char value for the key in this entry to be the specified character.
 long set(int index, long value)
          Sets the char value for the key in this entry to be the specified character.
 short set(int index, short value)
          Sets the short value for the key in this entry to be the specified character.
 
Methods inherited from interface java.util.Map.Entry
equals, getKey, getValue, hashCode, setValue
 

Method Detail

replaceKey

boolean replaceKey(K key)
Sets the key of this map entry to be the specified key if it is equal to the current key. If the specified key is not equal to the current key (as determined by the current key's equals method), this method does nothing and returns false.

Parameters:
key - a key equal to the current key as determined by the current key's equals method
Returns:
true if the specified key was equal to the current key and was therefore substituted for the current key, false otherwise

numBytes

int numBytes()
Returns the number of byte values associated with the key in this map entry, or 00 if the implementor does not associate bytes with its key


getByteValue

byte getByteValue()
Gets the byte value associated with the key contained in this entry. If an implementor associates multiple byte values, this method retrieves the first one.

Throws:
UnsupportedOperationException - if the implementor does not associate bytes with its keys

getByteValue

byte getByteValue(int index)
Returns the byte value of the specified index associated with the key in this map entry. If the implementor associates only a single byte with its key, then the specified index must be 0.

Parameters:
index - the index of the byte value to retrieve
Throws:
IllegalArgumentException - if
0 <= index < numBytes()
is false
UnsupportedOperationException - if the implementor does not associate bytes with its key

numShorts

int numShorts()
Returns the number of short values associated with the key in this map entry, or 0 if the implementor does not associate shorts with its key


getShortValue

short getShortValue()
Gets the short value associated with the key contained in this entry. If an implementor associates multiple short values, this method retrieves the first one.

Throws:
UnsupportedOperationException - if the implementor does not associate shorts with its keys

getShortValue

short getShortValue(int index)
Returns the short value of the specified index associated with the key in this map entry. If the implementor associates only a single short with its key, then the specified index must be 0.

Parameters:
index - the index of the short value to retrieve
Throws:
IllegalArgumentException - if
0 <= index < numShorts()
is false
UnsupportedOperationException - if the implementor does not associate shorts with its key

numChars

int numChars()
Returns the number of char values associated with the key in this map entry, or 0 if the implementor does not associate chars with its key


getCharValue

char getCharValue()
Gets the char value associated with the key contained in this entry. If an implementor associates multiple char values, this method retrieves the first one.

Throws:
UnsupportedOperationException - if the implementor does not associate chars with its keys

getCharValue

char getCharValue(int index)
Returns the char value of the specified index associated with the key in this map entry. If the implementor associates only a single char with its key, then the specified index must be 0.

Parameters:
index - the index of the char value to retrieve
Throws:
IllegalArgumentException - if
0 <= index < numChars()
is false
UnsupportedOperationException - if the implementor does not associate chars with its key

numInts

int numInts()
Returns the number of int values associated with the key in this map entry, or 0 if the implementor does not associate ints with its key


getIntValue

int getIntValue()
Gets the int value associated with the key contained in this entry. If an implementor associates multiple int values, this method retrieves the first one.

Throws:
UnsupportedOperationException - if the implementor does not associate ints with its keys

getIntValue

int getIntValue(int index)
Returns the int value of the specified index associated with the key in this map entry. If the implementor associates only a single int with its key, then the specified index must be 0.

Parameters:
index - the index of the int value to retrieve
Throws:
IllegalArgumentException - if
0 <= index < numInts()
is false
UnsupportedOperationException - if the implementor does not associate ints with its key

numLongs

int numLongs()
Returns the number of long values associated with the key in this map entry, or 0 if the implementor does not associate longs with its key


getLongValue

long getLongValue()
Gets the long value associated with the key contained in this entry. If an implementor associates multiple long values, this method retrieves the first one.

Throws:
UnsupportedOperationException - if the implementor does not associate longs with its keys

getLongValue

long getLongValue(int index)
Returns the long value of the specified index associated with the key in this map entry. If the implementor associates only a single long with its key, then the specified index must be 0.

Parameters:
index - the index of the long value to retrieve
Throws:
IllegalArgumentException - if
0 <= index < numLongs()
is false
UnsupportedOperationException - if the implementor does not associate longs with its key

numFloats

int numFloats()
Returns the number of float values associated with the key in this map entry, or 0 if the implementor does not associate floats with its key


getFloatValue

float getFloatValue()
Gets the float value associated with the key contained in this entry. If an implementor associates multiple float values, this method retrieves the first one.

Throws:
UnsupportedOperationException - if the implementor does not associate floats with its keys

getFloatValue

float getFloatValue(int index)
Returns the float value of the specified index associated with the key in this map entry. If the implementor associates only a single float with its key, then the specified index must be 0.

Parameters:
index - the index of the float value to retrieve
Throws:
IllegalArgumentException - if
0 <= index < numFloats()
is false
UnsupportedOperationException - if the implementor does not associate floats with its key

numDoubles

int numDoubles()
Returns the number of double values associated with the key in this map entry, or 0 if the implementor does not associate doubles with its key


getDoubleValue

double getDoubleValue()
Gets the double value associated with the key contained in this entry. If an implementor associates multiple double values, this method retrieves the first one.

Throws:
UnsupportedOperationException - if the implementor does not associate doubles with its keys

getDoubleValue

double getDoubleValue(int index)
Returns the double value of the specified index associated with the key in this map entry. If the implementor associates only a single double with its key, then the specified index must be 0.

Parameters:
index - the index of the double value to retrieve
Throws:
IllegalArgumentException - if
0 <= index < numDoubles()
is false
UnsupportedOperationException - if the implementor does not associate doubles with its key

set

byte set(int index,
         byte value)
Sets the char value for the key in this entry to be the specified character.

Parameters:
index - the index of the character value to set
value - the byte to which to set as a value for the key of this map entry
Throws:
UnsupportedOperationException - if the implementor does not associate bytes with its key

add

void add(byte addend)
Increments the byte at index 0 by the specified amount. This is simply a convenience method, completely equivalent to calling add(0, addend).

Parameters:
addend - the amount by which to increment the byte value at the specified index

add

void add(int index,
         byte addend)
Increments the byte at the specified index by the specified amount.

Parameters:
index - the index of the byte value to be incremented
addend - the amount by which to increment the byte value at the specified index

set

char set(int index,
         char value)
Sets the char value for the key in this entry to be the specified character.

Parameters:
index - the index of the character value to set
value - the character to set as a value for the key of this map entry
Throws:
UnsupportedOperationException - if the implementor does not associate chars with its key

set

short set(int index,
          short value)
Sets the short value for the key in this entry to be the specified character.

Parameters:
index - the index of the character value to set
value - the short to set as a value for the key of this map entry
Throws:
UnsupportedOperationException - if the implementor does not associate shorts with its key

add

void add(short addend)
Increments the short at index 0 by the specified amount. This is simply a convenience method, completely equivalent to calling add(0, addend).

Parameters:
addend - the amount by which to increment the short value at the specified index

add

void add(int index,
         short addend)
Increments the short at the specified index by the specified amount.

Parameters:
index - the index of the short value to be incremented
addend - the amount by which to increment the short value at the specified index

set

int set(int index,
        int value)
Sets the char value for the key in this entry to be the specified character.

Parameters:
index - the index of the character value to set
value - the character to set as a value for the key of this map entry
Throws:
UnsupportedOperationException - if the implementor does not associate ints with its key

add

void add(int addend)
Increments the int at index 0 by the specified amount. This is simply a convenience method, completely equivalent to calling add(0, addend).

Parameters:
addend - the amount by which to increment the int value at the specified index

add

void add(int index,
         int addend)
Increments the int at the specified index by the specified amount.

Parameters:
index - the index of the int value to be incremented
addend - the amount by which to increment the int value at the specified index

set

long set(int index,
         long value)
Sets the char value for the key in this entry to be the specified character.

Parameters:
index - the index of the character value to set
value - the long to set as a value for the key of this map entry
Throws:
UnsupportedOperationException - if the implementor does not associate longs with its key

add

void add(long addend)
Increments the long at index 0 by the specified amount. This is simply a convenience method, completely equivalent to calling add(0, addend).

Parameters:
addend - the amount by which to increment the long value at the specified index

add

void add(int index,
         long addend)
Increments the long at the specified index by the specified amount.

Parameters:
index - the index of the long value to be incremented
addend - the amount by which to increment the long value at the specified index

set

float set(int index,
          float value)
Sets the float value for the key in this entry to be the specified character.

Parameters:
index - the index of the character value to set
value - the float to set as a value for the key of this map entry
Throws:
UnsupportedOperationException - if the implementor does not associate floats with its key

add

void add(float addend)
Increments the float at index 0 by the specified amount. This is simply a convenience method, completely equivalent to calling add(0, addend).

Parameters:
addend - the amount by which to increment the float value at the specified index

add

void add(int index,
         float addend)
Increments the float at the specified index by the specified amount.

Parameters:
index - the index of the float value to be incremented
addend - the amount by which to increment the float value at the specified index

set

double set(int index,
           double value)
Sets the char value for the key in this entry to be the specified character.

Parameters:
index - the index of the character value to set
value - the double to set as a value for the key of this map entry
Throws:
UnsupportedOperationException - if the implementor does not associate doubles with its key

add

void add(double addend)
Increments the double at index 0 by the specified amount. This is simply a convenience method, completely equivalent to calling add(0, addend).

Parameters:
addend - the amount by which to increment the double value at the specified index

add

void add(int index,
         double addend)
Increments the double at the specified index by the specified amount.

Parameters:
index - the index of the double value to be incremented
addend - the amount by which to increment the double value at the specified index

Parsing Engine

Author: Dan Bikel.