improved names and javadoc

Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
Greg Wilkins 2019-04-29 14:09:21 +02:00
parent feb0333844
commit 1a76d487cc
2 changed files with 15 additions and 15 deletions

View File

@ -223,11 +223,10 @@ public class IncludeExcludeSet<T,P> implements Predicate<P>
return _includes.isEmpty() && _excludes.isEmpty(); return _includes.isEmpty() && _excludes.isEmpty();
} }
/** /**
* Combine the results of two {@link IncludeExcludeSet}s with an "and" operation. The items must be * Combine the results of two {@link IncludeExcludeSet}s with an "and"-like operation.
* included by xSet AND ySet, and excluded from neither. If a sets inclusions are empty, then all items * Item x must be included and not excluded by xSet AND item y must be included and not excluded by ySet.
* are considered to be included. * If a sets inclusions are empty, then all items are considered to be included.
* @param xSet The set that param x is tested against * @param xSet The set that param x is tested against
* @param x An item to test against xSet * @param x An item to test against xSet
* @param ySet The set that param y is tested against * @param ySet The set that param y is tested against
@ -250,11 +249,12 @@ public class IncludeExcludeSet<T,P> implements Predicate<P>
return true; return true;
} }
/** /**
* Combine the results of two {@link IncludeExcludeSet}s with an "or" operation. The items must be * Combine the results of two {@link IncludeExcludeSet}s with an "or"-like operation.
* included by xSet OR ySet, and excluded from neither. If a sets inclusions are empty, then all items * Item x must be included by xSet OR item y must be included ySet.
* are considered to be included. * Neither x nor y may be excluded for either respective set.
* If a sets inclusions are empty, then all items are considered to be included.
*
* @param xSet The set that param x is tested against * @param xSet The set that param x is tested against
* @param x An item to test against xSet * @param x An item to test against xSet
* @param ySet The set that param y is tested against * @param ySet The set that param y is tested against

View File

@ -489,7 +489,7 @@ public class ClasspathPattern extends AbstractSet<String>
} }
Map<String,Entry> _entries = new HashMap<>(); Map<String,Entry> _entries = new HashMap<>();
IncludeExcludeSet<Entry,String> _patterns = new IncludeExcludeSet<>(ByPackageOrName.class); IncludeExcludeSet<Entry,String> _packageOrNamePatterns = new IncludeExcludeSet<>(ByPackageOrName.class);
IncludeExcludeSet<Entry,URI> _locations = new IncludeExcludeSet<>(ByLocationOrModule.class); IncludeExcludeSet<Entry,URI> _locations = new IncludeExcludeSet<>(ByLocationOrModule.class);
public ClasspathPattern() public ClasspathPattern()
@ -591,9 +591,9 @@ public class ClasspathPattern extends AbstractSet<String>
else else
{ {
if (entry.isInclusive()) if (entry.isInclusive())
_patterns.include(entry); _packageOrNamePatterns.include(entry);
else else
_patterns.exclude(entry); _packageOrNamePatterns.exclude(entry);
} }
return true; return true;
} }
@ -620,7 +620,7 @@ public class ClasspathPattern extends AbstractSet<String>
public void clear() public void clear()
{ {
_entries.clear(); _entries.clear();
_patterns.clear(); _packageOrNamePatterns.clear();
_locations.clear(); _locations.clear();
} }
@ -673,7 +673,7 @@ public class ClasspathPattern extends AbstractSet<String>
*/ */
public boolean match(String name) public boolean match(String name)
{ {
return _patterns.test(name); return _packageOrNamePatterns.test(name);
} }
/** /**
@ -686,7 +686,7 @@ public class ClasspathPattern extends AbstractSet<String>
{ {
try try
{ {
return IncludeExcludeSet.or(_patterns, clazz.getName(), _locations, ()->TypeUtil.getLocationOfClass(clazz)); return IncludeExcludeSet.or(_packageOrNamePatterns, clazz.getName(), _locations, ()->TypeUtil.getLocationOfClass(clazz));
} }
catch (Exception e) catch (Exception e)
{ {
@ -704,7 +704,7 @@ public class ClasspathPattern extends AbstractSet<String>
// Treat path elements as packages for name matching // Treat path elements as packages for name matching
name=name.replace("/","."); name=name.replace("/",".");
return IncludeExcludeSet.or(_patterns, name, _locations, ()-> return IncludeExcludeSet.or(_packageOrNamePatterns, name, _locations, ()->
{ {
try try
{ {