java.lang.Object
com.aoapps.net.pathspace.PathSpace<V>
Manages a set of
Prefix
, identifying conflicts and providing efficient lookup
even when many prefixes are in the path space.
Each path space has an associated value.
This class is thread-safe.
- Author:
- AO Industries, Inc.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
PathSpace
public PathSpace()
-
-
Method Details
-
put
Adds a new prefix to this space while checking for conflicts.Note: This implementation is very simple and not optimized for performance. It does a sequential scan for the conflict check.
- Throws:
PrefixConflictException
- If the prefix conflicts with an existing entry.- See Also:
-
get
Gets the prefix associated with the given path.- Returns:
- The matching prefix or
null
if no match
-