/** * Retrieve the first object that is associated with the specified * internet address by taking into account the wildcard specifications. * * @param addr internet address * @return associated object */ public TYPE match(String addr) { Map.Entry<String, TYPE> entry = getMatch(addr); return entry==null ? null : entry.getValue(); }
/** * Dump a pattern map into a StringBuilder buffer * * @param buf buffer * @param patternMap pattern map to dump */ protected void dump(StringBuilder buf, IPAddressMap<PathMap> patternMap) { for (String addr: patternMap.keySet()) { for (Object path: ((PathMap)patternMap.get(addr)).values()) { buf.append("# "); buf.append(addr); buf.append("|"); buf.append(path); buf.append("\n"); } } } }
if (_white.size()>0) Object whiteObj = _white.getLazyMatches(addr); if (whiteObj != null) if (_black.size() > 0) Object blackObj = _black.getLazyMatches(addr); if (blackObj != null)
if (addrMap == null) addrMap = new IPAddressMap<Boolean>(); patternMap.put(path,addrMap); addrMap.put(addr, true);
/** * Helper method to process a list of new entries and replace * the content of the specified address pattern map * * @param entries new entries * @param patternMap target address pattern map */ protected void set(String[] entries, IPAddressMap<PathMap> patternMap) { patternMap.clear(); if (entries != null && entries.length > 0) { for (String addrPath:entries) { add(addrPath, patternMap); } } }
/** * Dump a pattern map into a StringBuilder buffer * * @param buf buffer * @param patternMap pattern map to dump */ protected void dump(StringBuilder buf, PathMap<IPAddressMap<Boolean>> patternMap) { for (String path: patternMap.keySet()) { for (String addr: patternMap.get(path).keySet()) { buf.append("# "); buf.append(addr); buf.append("|"); buf.append(path); buf.append("\n"); } } } }
/** * Dump a pattern map into a StringBuilder buffer * * @param buf buffer * @param patternMap pattern map to dump */ protected void dump(StringBuilder buf, IPAddressMap<PathMap> patternMap) { for (String addr: patternMap.keySet()) { for (Object path: ((PathMap)patternMap.get(addr)).values()) { buf.append("# "); buf.append(addr); buf.append("|"); buf.append(path); buf.append("\n"); } } } }
if (_white.size()>0) Object whiteObj = _white.getLazyMatches(addr); if (whiteObj != null) if (_black.size() > 0) Object blackObj = _black.getLazyMatches(addr); if (blackObj != null)
if (addrMap == null) addrMap = new IPAddressMap<Boolean>(); patternMap.put(path,addrMap); addrMap.put(addr, true);
/** * Helper method to process a list of new entries and replace * the content of the specified address pattern map * * @param entries new entries * @param patternMap target address pattern map */ protected void set(String[] entries, IPAddressMap<PathMap> patternMap) { patternMap.clear(); if (entries != null && entries.length > 0) { for (String addrPath:entries) { add(addrPath, patternMap); } } }
/** * Dump a pattern map into a StringBuilder buffer * * @param buf buffer * @param patternMap pattern map to dump */ protected void dump(StringBuilder buf, PathMap<IPAddressMap<Boolean>> patternMap) { for (String path: patternMap.keySet()) { for (String addr: patternMap.get(path).keySet()) { buf.append("# "); buf.append(addr); buf.append("|"); buf.append(path); buf.append("\n"); } } } }
/** * Dump a pattern map into a StringBuilder buffer * * @param buf buffer * @param patternMap pattern map to dump */ protected void dump(StringBuilder buf, IPAddressMap<PathMap> patternMap) { for (String addr: patternMap.keySet()) { for (Object path: ((PathMap)patternMap.get(addr)).values()) { buf.append("# "); buf.append(addr); buf.append("|"); buf.append(path); buf.append("\n"); } } } }
if (_white.size()>0) Object whiteObj = _white.getLazyMatches(addr); if (whiteObj != null) if (_black.size() > 0) Object blackObj = _black.getLazyMatches(addr); if (blackObj != null)
/** * Retrieve the first object that is associated with the specified * internet address by taking into account the wildcard specifications. * * @param addr internet address * @return associated object */ public TYPE match(String addr) { Map.Entry<String, TYPE> entry = getMatch(addr); return entry==null ? null : entry.getValue(); }
if (addrMap == null) addrMap = new IPAddressMap<Boolean>(); patternMap.put(path,addrMap); addrMap.put(addr, true);