|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bbn.openmap.omGraphics.geom.BasicGeometry
com.bbn.openmap.omGraphics.OMGraphic
com.bbn.openmap.omGraphics.OMGraphicList
com.bbn.openmap.omGraphics.OMGraphicHash
This is an OMGraphicsList cub-class with a Map interface. Access is backed by a HashMap. Insertion and removal of OMGraphics is through the Map interface.
The add(OMGraphic), addOMGraphic(OMGraphic), remove(OMGraphic), and removeOMGraphicAt(int) method are disabled and will throw a RuntimeException if called.
This class is suited for use as the top OMGraphicList in an OMHandlerLayer that has a large number of OMGraphic objects and needs to access those objects using a unique key.
OMGraphicList
,
Serialized FormNested Class Summary |
Nested classes inherited from class com.bbn.openmap.omGraphics.OMGraphicList |
OMGraphicList.OMDist |
Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
Field Summary |
Fields inherited from class com.bbn.openmap.omGraphics.OMGraphicList |
allowDuplicates, FIRST_ADDED_ON_TOP, graphics, LAST_ADDED_ON_TOP, NONE, processAllGeometries, traverseMode, vague |
Fields inherited from class com.bbn.openmap.omGraphics.OMGraphic |
declutterType, displayPaint, edgeMatchesFill, fillPaint, hasLabel, linePaint, matted, mattingPaint, renderType, selected, selectPaint, showEditablePalette, stroke, textureMask |
Fields inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry |
APP_OBJECT_KEY, appObject, ATT_MAP_KEY, lineType, needToRegenerate, shape, visible |
Constructor Summary | |
OMGraphicHash()
Creates a new instance of OMGraphicHash |
|
OMGraphicHash(int initialCapacity)
Construct an OMGraphicList with an initial capacity. |
Method Summary | |
void |
add(OMGraphic g)
Add an OMGraphic to the list. |
void |
addOMGraphic(OMGraphic g)
Add an OMGraphic to the GraphicList. |
void |
clear()
Remove all elements from the graphic list. |
java.lang.Object |
clone()
Generic return of SinkGraphic for subclasses that don't implement clone properly for some reason. |
boolean |
containsKey(java.lang.Object obj)
Returns true if this map contains a mapping for the specified key. |
boolean |
containsValue(java.lang.Object obj)
Returns true if this map maps one or more keys to the specified value. |
java.util.Set |
entrySet()
Returns a set view of the mappings contained in this map. |
java.lang.Object |
get(java.lang.Object obj)
Returns the value to which this map maps the specified key. |
java.util.Set |
keySet()
Returns a set view of the keys contained in this map. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object graphic)
Associates the specified value with the specified key in this map (optional operation). |
void |
putAll(java.util.Map map)
Copies all of the mappings from the specified map to this map (optional operation). |
java.lang.Object |
remove(java.lang.Object obj)
Removes the mapping for this key from this map if it is present (optional operation). |
boolean |
remove(OMGraphic graphic)
Remove the graphic. |
void |
removeOMGraphicAt(int location)
Remove the graphic at the location number. |
java.util.Collection |
values()
Returns a collection view of the values contained in this map. |
Methods inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry |
_distance, appendShapeEdge, appendShapeEdge, appendShapeEdge, appendShapeEdge, checkAttributeMap, checkAttributeMap, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, draw, fill, getAppObject, getAppObject, getAttribute, getAttributeMap, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, putAttribute, removeAttribute, replaceAppObjectWithAttributeMap, setAppObject, setAppObject, setAttributes, setLineType, setNeedToRegenerate |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode, isEmpty, size |
Methods inherited from interface com.bbn.openmap.omGraphics.OMGeometry |
clearAttributes, contains, draw, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate |
Constructor Detail |
public OMGraphicHash()
public OMGraphicHash(int initialCapacity)
initialCapacity
- the initial capacity of the listMethod Detail |
public java.lang.Object get(java.lang.Object obj)
More formally, if this map contains a mapping from a key k to a value v such that (key==null ? k==null : key.equals(k)), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)
get
in interface java.util.Map
java.lang.ClassCastException
- if the key is of an inappropriate type for
this map (optional).
java.lang.NullPointerException
- if the key is null and this map
does not permit null keys (optional).containsKey(Object)
public boolean containsKey(java.lang.Object obj)
containsKey
in interface java.util.Map
java.lang.ClassCastException
- if the key is of an inappropriate type for
this map (optional).
java.lang.NullPointerException
- if the key is null and this map
does not permit null keys (optional).public boolean containsValue(java.lang.Object obj)
containsValue
in interface java.util.Map
java.lang.ClassCastException
- if the value is of an inappropriate type for
this map (optional).
java.lang.NullPointerException
- if the value is null and this map
does not permit null values (optional).public java.util.Set entrySet()
Map.Entry
. The set is backed by the map,
so changes to the map are reflected in the set, and vice-versa. If the
map is modified while an iteration over the set is in progress (except
through the iterator's own remove operation, or through the
setValue operation on a map entry returned by the iterator)
the results of the iteration are undefined. The set supports element
removal, which removes the corresponding mapping from the map, via the
Iterator.remove, Set.remove, removeAll,
retainAll and clear operations. It does not support
the add or addAll operations.
entrySet
in interface java.util.Map
public java.util.Set keySet()
keySet
in interface java.util.Map
public java.lang.Object put(java.lang.Object key, java.lang.Object graphic)
m.containsKey(k)
would return true.))
put
in interface java.util.Map
key
- key with which the specified value is to be associated.
java.lang.UnsupportedOperationException
- if the put operation is
not supported by this map.
java.lang.ClassCastException
- if the class of the specified key or value
prevents it from being stored in this map.
java.lang.IllegalArgumentException
- if some aspect of this key or value
prevents it from being stored in this map.
java.lang.NullPointerException
- if this map does not permit null
keys or values, and the specified key or value is null.public void putAll(java.util.Map map)
put(k, v)
on this map once for each mapping
from key k to value v in the specified map. The
behavior of this operation is unspecified if the specified map is
modified while the operation is in progress.
putAll
in interface java.util.Map
java.lang.UnsupportedOperationException
- if the putAll method is
not supported by this map.
java.lang.ClassCastException
- if the class of a key or value in the
specified map prevents it from being stored in this map.
java.lang.IllegalArgumentException
- some aspect of a key or value in the
specified map prevents it from being stored in this map.
java.lang.NullPointerException
- if the specified map is null, or
if this map does not permit null keys or values, and
the specified map contains null keys or values.public java.lang.Object remove(java.lang.Object obj)
(key==null ? k==null : key.equals(k))
, that mapping is
removed. (The map can contain at most one such mapping.)
Returns the value to which the map previously associated the key, or null if the map contained no mapping for this key. (A null return can also indicate that the map previously associated null with the specified key if the implementation supports null values.) The map will not contain a mapping for the specified key once the call returns.
remove
in interface java.util.Map
java.lang.ClassCastException
- if the key is of an inappropriate type for
this map (optional).
java.lang.NullPointerException
- if the key is null and this map
does not permit null keys (optional).
java.lang.UnsupportedOperationException
- if the remove method is
not supported by this map.public java.util.Collection values()
values
in interface java.util.Map
public java.lang.Object clone()
OMGraphic
clone
in class OMGraphicList
public void addOMGraphic(OMGraphic g)
For OMGraphicHash this method will throw an
IllegalArgumentException
because adding a graphic must be
done through put(key,value)
.
addOMGraphic
in class OMGraphicList
g
- the non-null OMGraphic to add
java.lang.IllegalArgumentException
- if OMGraphic is nullpublic void add(OMGraphic g)
For OMGraphicHash this method will throw an
IllegalArgumentException
because adding a graphic must be
done through put(key,value)
.
add
in class OMGraphicList
public void removeOMGraphicAt(int location)
For OMGraphicHash this method will throw an
IllegalArgumentException
because removing a graphic must
be done through remove(key)
.
removeOMGraphicAt
in class OMGraphicList
location
- the location of the OMGraphic to remove.public boolean remove(OMGraphic graphic)
For OMGraphicHash this method will throw an
IllegalArgumentException
because removing a graphic must
be done through remove(key)
.
remove
in class OMGraphicList
graphic
- the OMGraphic object to remove.
public void clear()
clear
in interface java.util.Map
clear
in class OMGraphicList
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |