Parsing Engine

danbikel.util
Class HashMapInt.Entry<K>

java.lang.Object
  extended by danbikel.util.AbstractMapToPrimitive.Entry<K>
      extended by danbikel.util.HashMapPrimitive.Entry<K>
          extended by danbikel.util.HashMapInt.Entry<K>
All Implemented Interfaces:
MapToPrimitive.Entry<K>, Externalizable, Serializable, Map.Entry<K,Object>
Enclosing class:
HashMapInt<K>

protected static class HashMapInt.Entry<K>
extends HashMapPrimitive.Entry<K>

A map entry for this type of map, containing a key and an int.

See Also:
Serialized Form

Field Summary
protected  int intVal0
           
 
Fields inherited from class danbikel.util.HashMapPrimitive.Entry
keyHash, next
 
Fields inherited from class danbikel.util.AbstractMapToPrimitive.Entry
key
 
Constructor Summary
  HashMapInt.Entry()
          Constructs a new entry for this type of map with default values for the data members (this default constructor here for serialization reasons).
protected HashMapInt.Entry(int hash, K key, HashMapPrimitive.Entry<K> next)
          Constructs a new entry for a map from objects to ints.
protected HashMapInt.Entry(int hash, K key, int value, HashMapPrimitive.Entry<K> next)
          Constructs a new entry for a map from objects to ints.
 
Method Summary
 void add(int index, int addend)
          Adds the specified amount to the int associated with the key in this entry.
 Object clone()
          Returns a new copy of this type of map entry.
 void copyValuesFrom(HashMapPrimitive.Entry copyFrom)
          Makes the data membes in this entry be identical to those in the specified entry by performing a shallow copy.
 boolean equals(Object o)
           
 int getIntValue(int index)
          Returns the int value associated with the key in this entry.
 Object getValue()
          Returns an Integer whose value is the int in this entry.
 int hashCode()
           
 int numInts()
          Returns 1, the number of ints associated with a key.
 void readValues(ObjectInput in)
           
 int set(int index, int value)
          Sets the int value associated with the key in this entry.
 String toString()
           
 void writeValues(ObjectOutput out)
           
 
Methods inherited from class danbikel.util.HashMapPrimitive.Entry
readExternal, replaceKey, setValue, writeExternal
 
Methods inherited from class danbikel.util.AbstractMapToPrimitive.Entry
add, add, add, add, add, add, add, add, add, add, add, getByteValue, getByteValue, getCharValue, getCharValue, getDoubleValue, getDoubleValue, getFloatValue, getFloatValue, getIntValue, getKey, getLongValue, getLongValue, getShortValue, getShortValue, numBytes, numChars, numDoubles, numFloats, numLongs, numShorts, set, set, set, set, set, set
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

intVal0

protected transient int intVal0
Constructor Detail

HashMapInt.Entry

public HashMapInt.Entry()
Constructs a new entry for this type of map with default values for the data members (this default constructor here for serialization reasons).


HashMapInt.Entry

protected HashMapInt.Entry(int hash,
                           K key,
                           HashMapPrimitive.Entry<K> next)
Constructs a new entry for a map from objects to ints.

Parameters:
hash - the hash value for the specified key
key - the key for this entry to wrap
next - the next pointer in this entry’s singly-linked list

HashMapInt.Entry

protected HashMapInt.Entry(int hash,
                           K key,
                           int value,
                           HashMapPrimitive.Entry<K> next)
Constructs a new entry for a map from objects to ints.

Parameters:
hash - the hash value for the specified key
key - the key for this entry to wrap
value - the int value to be associated with the specified key in the map
next - the next pointer in this entry’s singly-linked list
Method Detail

getValue

public Object getValue()
Returns an Integer whose value is the int in this entry.

Warning: This method uses auto-boxing, and is intended primarily for debugging purposes.

Specified by:
getValue in interface Map.Entry<K,Object>
Overrides:
getValue in class HashMapPrimitive.Entry<K>
Returns:
an Integer whose value is the int in this entry

numInts

public int numInts()
Returns 1, the number of ints associated with a key.

Specified by:
numInts in interface MapToPrimitive.Entry<K>
Overrides:
numInts in class AbstractMapToPrimitive.Entry<K>
Returns:
1, the number of ints associated with a key

getIntValue

public int getIntValue(int index)
Returns the int value associated with the key in this entry.

Specified by:
getIntValue in interface MapToPrimitive.Entry<K>
Overrides:
getIntValue in class AbstractMapToPrimitive.Entry<K>
Parameters:
index - an ignored parameter
Returns:
the int value associated with the key in this entry

set

public int set(int index,
               int value)
Sets the int value associated with the key in this entry.

Specified by:
set in interface MapToPrimitive.Entry<K>
Overrides:
set in class AbstractMapToPrimitive.Entry<K>
Parameters:
index - an ignored parameter
value - the value to associated with the key in this entry
Returns:
the old value associated with the key in this entry

add

public void add(int index,
                int addend)
Adds the specified amount to the int associated with the key in this entry.

Specified by:
add in interface MapToPrimitive.Entry<K>
Overrides:
add in class AbstractMapToPrimitive.Entry<K>
Parameters:
index - an ignored parameter
addend - the amount to add to the int associated with the key in this entry

copyValuesFrom

public void copyValuesFrom(HashMapPrimitive.Entry copyFrom)
Makes the data membes in this entry be identical to those in the specified entry by performing a shallow copy.

Specified by:
copyValuesFrom in class HashMapPrimitive.Entry<K>
Parameters:
copyFrom - the entry from which to copy

toString

public String toString()
Specified by:
toString in class HashMapPrimitive.Entry<K>

hashCode

public int hashCode()
Specified by:
hashCode in interface Map.Entry<K,Object>
Specified by:
hashCode in class HashMapPrimitive.Entry<K>

equals

public boolean equals(Object o)
Specified by:
equals in interface Map.Entry<K,Object>
Specified by:
equals in class HashMapPrimitive.Entry<K>

clone

public Object clone()
Description copied from class: HashMapPrimitive.Entry
Returns a new copy of this type of map entry.

Specified by:
clone in class HashMapPrimitive.Entry<K>

writeValues

public void writeValues(ObjectOutput out)
                 throws IOException
Specified by:
writeValues in class HashMapPrimitive.Entry<K>
Throws:
IOException

readValues

public void readValues(ObjectInput in)
                throws IOException,
                       ClassNotFoundException
Specified by:
readValues in class HashMapPrimitive.Entry<K>
Throws:
IOException
ClassNotFoundException

Parsing Engine

Author: Dan Bikel.