thredds.logs
Class PathMatcher

java.lang.Object
  extended by thredds.logs.PathMatcher

public class PathMatcher
extends Object

Duplicate thredds.servlet.PathMatcher

Since:
Mar 24, 2009
Author:
caron

Nested Class Summary
 class PathMatcher.Match
           
 
Constructor Summary
PathMatcher()
           
 
Method Summary
 PathMatcher.Match get(String key)
          See if this object already exists in the collection, using equals().
 Iterator iterator()
          Get an iterator over the values, in sorted order.
static void main(String[] args)
           
 PathMatcher.Match match(String path)
          Find the longest match.
 void put(String root, String dir)
          Add an object to the collection to be searched by a String key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathMatcher

public PathMatcher()
Method Detail

put

public void put(String root,
                String dir)
Add an object to the collection to be searched by a String key.

Parameters:
root - sort key
dir - add this object to the list to be searched.

get

public PathMatcher.Match get(String key)
See if this object already exists in the collection, using equals().

Parameters:
key - find object that has this key
Returns:
existing object, else null.

iterator

public Iterator iterator()
Get an iterator over the values, in sorted order.

Returns:
iterator

match

public PathMatcher.Match match(String path)
Find the longest match.

Parameters:
path - find object with longesh match where path.startsWith( key)
Returns:
the value whose key is the longest that matches path, or null if none

main

public static void main(String[] args)


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.