public class OrderedStringKeyMap
extends java.lang.Object
Constructor and Description |
---|
OrderedStringKeyMap()
creates a new OrderedMap
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all of the elements from this key map.
|
boolean |
contains(java.lang.Object o)
Checks if this map contains the specified value.
|
boolean |
contains(java.lang.String key)
Checks if this map contains the specified key.
|
boolean |
containsKey(java.lang.String key)
Checks if this map contains the specified key.
|
boolean |
containsValue(java.lang.Object o)
Checks if this map contains the specified value.
|
java.util.Set |
entrySet()
Returns a collection view of the mappings contained in this map.
|
java.lang.Object |
get(int index)
Returns the element at the specified position in this list.
|
java.lang.Object |
get(java.lang.String key)
Returns the value with the given
key or null if
the values is not in this map. |
int |
indexOf(java.lang.Object value)
Searches for the first occurence of the given argument, testing
for equality using the equals method.
|
boolean |
isEmpty()
Checks if this map is empty.
|
java.util.Iterator |
iterator()
Returns an iterator over the elements in this list in proper
sequence.
|
java.util.Iterator |
iterator(boolean reverse)
Returns an iterator over the elements in this list in proper
sequence.
|
java.util.Iterator |
keys()
Returns an iterator over all keys in the map in any order.
|
java.util.Set |
keySet()
Returns a set view of the keys contained in this map.
|
java.lang.Object |
lastElement()
Returns the last element of this list, or
null if this list
is empty. |
void |
move(java.lang.String key,
java.lang.String above)
Moves the element with the
key above the one specified
with above . |
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
Puts an element into the map and appends it to the end of the list.
|
java.lang.Object |
put(java.lang.String key,
java.lang.Object value,
int index)
Inserts the specified element at the specified position in this
list.
|
java.lang.Object |
put(java.lang.String key,
java.lang.Object value,
java.lang.String above)
Inserts the specified element above the element specified with
above . |
java.lang.Object |
remove(int index)
Removes the element at the specified position in this list.
|
java.lang.Object |
remove(java.lang.String key)
Removes the mapping for this key from this map if present.
|
java.lang.Object |
set(java.lang.String key,
java.lang.Object value)
Puts an element in this key map and replaces it in the internal list
if an element with the key already exists, or appends it to the end
of the list, otherwise.
|
int |
size()
Returns the number of the elelemts in this map
|
java.lang.Object[] |
toArray()
Returns an array containing all of the elements in this list
in the correct order.
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
Returns an array containing all of the elements in this list in the
correct order.
|
public int size()
public boolean isEmpty()
true
if this map is empty;
false
otherwise.public boolean contains(java.lang.Object o)
o
- the object the checktrue
if this map contains the value;
false
otherwise.public boolean contains(java.lang.String key)
key
- the key to checktrue
if this map contaisn the key;
false
otherwise.public boolean containsValue(java.lang.Object o)
o
- the object the checktrue
if this map contains the value;
false
otherwise.public boolean containsKey(java.lang.String key)
key
- the key to checktrue
if this map contaisn the key;
false
otherwise.public java.lang.Object get(java.lang.String key)
key
or null
if
the values is not in this map.key
- the key of the valuenull
public java.lang.Object get(int index)
index
- index of element to return.java.lang.IndexOutOfBoundsException
- if index is out of range (index
< 0 || index >= size()).public java.util.Iterator iterator()
public java.util.Iterator iterator(boolean reverse)
reverse
- if set to true
, the elemens are iterated in
reverse orderpublic java.util.Iterator keys()
public java.lang.Object[] toArray()
public java.lang.Object[] toArray(java.lang.Object[] a)
If the list fits in the specified array with room to spare (i.e., the array has more elements than the list), the element in the array immediately following the end of the collection is set to null. This is useful in determining the length of the list only if the caller knows that the list does not contain any null elements.
a
- the array into which the elements of the list are to
be stored, if it is big enough; otherwise, a new array of the
same runtime type is allocated for this purpose.java.lang.ArrayStoreException
- if the runtime type of a is not a supertype
of the runtime type of every element in this list.public void clear()
public java.lang.Object put(java.lang.String key, java.lang.Object value)
key
- the key of the elementvalue
- the value of the elementnull
if there was no such element.public java.lang.Object set(java.lang.String key, java.lang.Object value)
key
- the key of the elementvalue
- the value of the elementnull
if there was no such element.public int indexOf(java.lang.Object value)
value
- an object.Object.equals(Object)
public java.lang.Object put(java.lang.String key, java.lang.Object value, int index)
key
- the key of the elementvalue
- element to be inserted.index
- index at which the specified element is to be inserted.null
if there was no such element.java.lang.IndexOutOfBoundsException
- if index is out of range
(index < 0 || index > size()).public java.lang.Object put(java.lang.String key, java.lang.Object value, java.lang.String above)
above
.key
- the key of the elementvalue
- element to be inserted.above
- the key of the element to insert abovenull
if there was no such element.public java.lang.Object remove(java.lang.String key)
key
- key whose mapping is to be removed from the map.public java.lang.Object remove(int index)
index
- the index of the element to removed.java.lang.IndexOutOfBoundsException
- if index out of range (index
< 0 || index >= size()).public java.lang.Object lastElement()
null
if this list
is empty.public void move(java.lang.String key, java.lang.String above)
key
above the one specified
with above
.public java.util.Set entrySet()
Map.Entry
public java.util.Set keySet()
Copyright © 2010 - 2020 Adobe. All Rights Reserved