KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > core > util > HeaderMap


1 /*******************************************************************************
2  * Copyright (c) 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.core.util;
12
13 import java.util.Comparator JavaDoc;
14 import java.util.TreeMap JavaDoc;
15
16 /**
17  *
18  * Designed as a Map to contain Manifest headers and values. Returns
19  * the value of a header if it matches (case insensitive) to the key.
20  *
21  */

22 public class HeaderMap extends TreeMap JavaDoc {
23
24     private static final long serialVersionUID = 1L;
25     
26     private static class HeaderComparator implements Comparator JavaDoc {
27         public int compare(Object JavaDoc arg0, Object JavaDoc arg1) {
28             String JavaDoc header0 = (String JavaDoc)arg0;
29             String JavaDoc header1 = (String JavaDoc)arg1;
30             return header0.compareToIgnoreCase(header1);
31         }
32     }
33     
34     public HeaderMap() {
35         super(new HeaderComparator());
36     }
37
38 }
39
Popular Tags