|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<K,V> java.util.TreeMap<java.lang.String,V> ikrs.util.FileExtensionKeyMap<V>
public class FileExtensionKeyMap<V>
As there is a small issue mapping file extensions in different styles; if you store a file extension ".txt" to this map (key) looking up ".TXT" or "txt" won't retrieve the mapped value if using a regular String orientated map. This map uses a case-insensitive key comparator (so ".txt" and ".TXT" are the same) and handles the preceding dot "." (so ".txt" and "txt" are the same). Both settings are optional.
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 | |
---|---|
FileExtensionKeyMap()
|
|
FileExtensionKeyMap(boolean isStrict,
boolean isCaseSensitive)
|
Method Summary | |
---|---|
V |
get(java.lang.Object fileExtension)
This method overrides TreeMap.get(String) to adapt the file extension mapping. |
protected V |
get(java.lang.String fileExtension)
This method tries to resolve multiple meanings of the file extension. |
static void |
main(java.lang.String[] argv)
For testing only. |
Methods inherited from class java.util.TreeMap |
---|
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, 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 |
---|
public FileExtensionKeyMap()
public FileExtensionKeyMap(boolean isStrict, boolean isCaseSensitive)
Method Detail |
---|
public V get(java.lang.Object fileExtension)
get
in interface java.util.Map<java.lang.String,V>
get
in class java.util.TreeMap<java.lang.String,V>
protected V get(java.lang.String fileExtension)
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |