Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.activemq.filter
Class DestinationMap

    java.lang.Object
      org.codehaus.activemq.filter.DestinationMap

public class DestinationMap
extends Object

A Map-like data structure allowing values to be indexed by `ActiveMQDestination` and retrieved by destination - supporting both * and > style of wildcard as well as composite destinations.
This class assumes that the index changes rarely but that fast lookup into the index is required. So this class maintains a pre-calculated index for destination steps. So looking up the values for "TEST.*" or "*.TEST" will be pretty fast.
Looking up of a value could return a single value or a List of matching values if a wildcard or composite destination is used.

Version:
  $Revision: 1.5 $

Field Summary
`protected static String` | `ANY_CHILD`
`protected static String` | `ANY_DESCENDENT`

Constructor Summary
`DestinationMap()`

Method Summary
`protected Set` | `findWildcardMatches(ActiveMQDestination key)`
`Set` | `get(ActiveMQDestination key)` Looks up the value(s) matching the given Destination key.
`void` | `put(ActiveMQDestination key, Object value)`
`void` | `remove(ActiveMQDestination key, Object value)` Removes the value from the associated destination

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ANY_DESCENDENT

    protected static final String ANY_DESCENDENT

See Also:
  Constant Field Values

### ANY_CHILD

    protected static final String ANY_CHILD

See Also:
  Constant Field Values

Constructor Detail

### DestinationMap

    public DestinationMap()

Method Detail

### get

    public Set get(ActiveMQDestination key)

  Looks up the value(s) matching the given Destination key. For simple destinations this is typically a List of one single value, for wildcards or composite destinations this will typically be a List of matching values.

  Parameters:
    `key` - the destination to lookup
  Returns:
    a List of matching values or an empty list if there are no matching values.

### put

    public void put(ActiveMQDestination key,
                    Object value)

### remove

    public void remove(ActiveMQDestination key,
                       Object value)

  Removes the value from the associated destination

### findWildcardMatches

    protected Set findWildcardMatches(ActiveMQDestination key)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Protique, Ltd.. All Rights Reserved.