org.openmdx.base.collection
Interface FilterableMap

All Superinterfaces:
Map
All Known Implementing Classes:
DelegatingContainer, MarshallingContainer_1, MarshallingFilterableMap

public interface FilterableMap
extends Map

The Container interface adds the ability to filter and order its elements to a Collection.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Method Summary
 FilterableMap subMap(Object filter)
          Selects objects matching the filter.
 List values(Object criteria)
          Applies given criteria to the elements of the container and returns the result as list.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

subMap

FilterableMap subMap(Object filter)
Selects objects matching the filter.

The semantics of the collection returned by this method become undefined if the backing collection (i.e., this container) is structurally modified in any way other than via the returned collection. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)

This method returns a Collection as opposed to a Set because it behaves as set in respect to object id equality, not element equality.

The acceptable filter object classes must be specified by the container implementation.

Parameters:
filter - The filter to be applied to objects of this container
Returns:
A subset of this container containing the objects matching the filter.
Throws:
ClassCastException - if the class of the specified filter prevents it from being applied to this container.
IllegalArgumentException - if some aspect of this filter prevents it from being applied to this container.

values

List values(Object criteria)
Applies given criteria to the elements of the container and returns the result as list.

The acceptable criteria classes must be specified by the container implementation.

Parameters:
criteria - The criteria to be applied to objects of this container; or null for all the container's elements in their default order.
Returns:
a list based on the container's elements and the given criteria.
Throws:
ClassCastException - if the class of the specified criteria prevents them from being applied to this container's elements.
IllegalArgumentException - if some aspect of the criteria prevents them from being applied to this container's elements.


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.