org.achartengine.util
Class IndexXYMap<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.TreeMap<K,V>
          extended by org.achartengine.util.IndexXYMap<K,V>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<K,V>, java.util.NavigableMap<K,V>, java.util.SortedMap<K,V>

public class IndexXYMap<K,V>
extends java.util.TreeMap<K,V>

This class requires sorted x values

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
IndexXYMap()
           
 
Method Summary
 void clear()
           
 XYEntry<K,V> getByIndex(int index)
          Returns XY-entry according to the given index
 int getIndexForKey(K key)
           
 double getMaxXDifference()
           
 K getXByIndex(int index)
          Returns X-value according to the given index
 V getYByIndex(int index)
          Returns Y-value according to the given index
 V put(int index, K key, V value)
           
 V put(K key, V value)
           
 XYEntry<K,V> removeByIndex(int index)
          Removes entry from map by index
 
Methods inherited from class java.util.TreeMap
ceilingEntry, ceilingKey, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, putAll, remove, size, subMap, subMap, tailMap, tailMap, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, isEmpty, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode, isEmpty
 

Constructor Detail

IndexXYMap

public IndexXYMap()
Method Detail

put

public V put(K key,
             V value)
Specified by:
put in interface java.util.Map<K,V>
Overrides:
put in class java.util.TreeMap<K,V>

put

public V put(int index,
             K key,
             V value)

getMaxXDifference

public double getMaxXDifference()

clear

public void clear()
Specified by:
clear in interface java.util.Map<K,V>
Overrides:
clear in class java.util.TreeMap<K,V>

getXByIndex

public K getXByIndex(int index)
Returns X-value according to the given index

Parameters:
index -
Returns:
the X value

getYByIndex

public V getYByIndex(int index)
Returns Y-value according to the given index

Parameters:
index -
Returns:
the Y value

getByIndex

public XYEntry<K,V> getByIndex(int index)
Returns XY-entry according to the given index

Parameters:
index -
Returns:
the X and Y values

removeByIndex

public XYEntry<K,V> removeByIndex(int index)
Removes entry from map by index

Parameters:
index -

getIndexForKey

public int getIndexForKey(K key)


Copyright © 2009 - 2011 4ViewSoft. All Rights Reserved.