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();
}
/**
* Combine the results of two {@link IncludeExcludeSet}s with an "and" operation. The items must be
* included by xSet AND ySet, and excluded from neither. If a sets inclusions are empty, then all items
* are considered to be included.
* Combine the results of two {@link IncludeExcludeSet}s with an "and"-like operation.
* Item x must be included and not excluded by xSet AND item y must be included and not excluded by ySet.
* 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 x An item to test against xSet
* @param ySet The set that param y is tested against
@ -250,11 +249,12 @@ public class IncludeExcludeSet<T,P> implements Predicate<P>
return true;
}
/**
* Combine the results of two {@link IncludeExcludeSet}s with an "or" operation. The items must be
* included by xSet OR ySet, and excluded from neither. If a sets inclusions are empty, then all items
* are considered to be included.
* Combine the results of two {@link IncludeExcludeSet}s with an "or"-like operation.
* Item x must be included by xSet OR item y must be included ySet.
* 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 x An item to test against xSet
* @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<>();
IncludeExcludeSet<Entry,String> _patterns = new IncludeExcludeSet<>(ByPackageOrName.class);
IncludeExcludeSet<Entry,String> _packageOrNamePatterns = new IncludeExcludeSet<>(ByPackageOrName.class);
IncludeExcludeSet<Entry,URI> _locations = new IncludeExcludeSet<>(ByLocationOrModule.class);
public ClasspathPattern()
@ -591,9 +591,9 @@ public class ClasspathPattern extends AbstractSet<String>
else
{
if (entry.isInclusive())
_patterns.include(entry);
_packageOrNamePatterns.include(entry);
else
_patterns.exclude(entry);
_packageOrNamePatterns.exclude(entry);
}
return true;
}
@ -620,7 +620,7 @@ public class ClasspathPattern extends AbstractSet<String>
public void clear()
{
_entries.clear();
_patterns.clear();
_packageOrNamePatterns.clear();
_locations.clear();
}
@ -673,7 +673,7 @@ public class ClasspathPattern extends AbstractSet<String>
*/
public boolean match(String name)
{
return _patterns.test(name);
return _packageOrNamePatterns.test(name);
}
/**
@ -686,7 +686,7 @@ public class ClasspathPattern extends AbstractSet<String>
{
try
{
return IncludeExcludeSet.or(_patterns, clazz.getName(), _locations, ()->TypeUtil.getLocationOfClass(clazz));
return IncludeExcludeSet.or(_packageOrNamePatterns, clazz.getName(), _locations, ()->TypeUtil.getLocationOfClass(clazz));
}
catch (Exception e)
{
@ -704,7 +704,7 @@ public class ClasspathPattern extends AbstractSet<String>
// Treat path elements as packages for name matching
name=name.replace("/",".");
return IncludeExcludeSet.or(_patterns, name, _locations, ()->
return IncludeExcludeSet.or(_packageOrNamePatterns, name, _locations, ()->
{
try
{