db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/util/collections ManageableSortedMapImpl.java
Date Mon, 07 Feb 2005 21:59:23 GMT
brj         2005/02/07 13:59:23

  Added:       src/java/org/apache/ojb/broker/util/collections
                        ManageableSortedMapImpl.java
  Log:
  manageable SortedMap
  
  Revision  Changes    Path
  1.1                  db-ojb/src/java/org/apache/ojb/broker/util/collections/ManageableSortedMapImpl.java
  
  Index: ManageableSortedMapImpl.java
  ===================================================================
  package org.apache.ojb.broker.util.collections;
  
  /* Copyright 2003-2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  import java.util.Comparator;
  import java.util.SortedMap;
  import java.util.TreeMap;
  
  /**
   * Manageable Wrapper for SortedMap.
   *
   * @author <a href="mailto:jbraeuchi@gmx.ch">Jakob Braeuchi</a>
   * @version $Id: ManageableSortedMapImpl.java,v 1.1 2005/02/07 21:59:23 brj Exp $
   */
  public class ManageableSortedMapImpl extends ManageableMapImpl implements SortedMap
  {
      private static final long serialVersionUID = 3904963032080856377L;
  
      /**
       * Default Constructor. Wraps a TreeMAp
       */
      public ManageableSortedMapImpl()
      {
          this(new TreeMap());
      }
  
      /**
       * @param map the wrapped SortedMap
       */
      public ManageableSortedMapImpl(SortedMap map)
      {
          super(map);
      }
  
      /**
       * @return Returns the sortedMap.
       */
      private SortedMap getSortedMap()
      {
          return (SortedMap) getMap();
      }
  
      public Object firstKey()
      {
          return getSortedMap().firstKey();
      }
  
      public Object lastKey()
      {
          return getSortedMap().lastKey();
      }
  
      public Comparator comparator()
      {
          return getSortedMap().comparator();
      }
  
      public SortedMap headMap(Object toKey)
      {
          return getSortedMap().headMap(toKey);
      }
  
      public SortedMap tailMap(Object fromKey)
      {
          return getSortedMap().tailMap(fromKey);
      }
  
      public SortedMap subMap(Object fromKey, Object toKey)
      {
          return getSortedMap().subMap(fromKey, toKey);
      }
  
  }
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message