public abstract class AbstractDelegateSlice extends Object implements Slice
Constructor and Description |
---|
AbstractDelegateSlice() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Clazz entry)
Check whether a class belongs to a slice.
|
Slice |
dependencyClosure(Slice within)
Calculates the transitive closure of this slice's classes and their dependencies
intersected with the within slice.
|
Set<Clazz> |
getClazzes()
Returns all classes belonging to this slice.
|
protected abstract Slice |
getDelegate() |
ConcreteSlice |
getDependencies()
Returns a slice of all the dependencies of this slice.
|
Slice |
minus(Iterable<? extends Slice> slices)
Creates a new slice that resembles the difference of this slice and the
slices passed.
|
Slice |
minus(Predicate<Clazz> predicate)
This is a convenience method for
this.minus(this.slice(predicate)) . |
Slice |
minus(Slice... slices)
Creates a new slice that resembles the difference of this slice and the
slices passed.
|
Slice |
minus(String pattern)
This is a convenience method for
this.minus(this.slice(pattern)) . |
Slice |
named(String name)
Creates a new
Slice from this slice for which the
Object.toString() returns name. |
SortedMap<String,PartitionSlice> |
partitionBy(SlicePartitioner partitioner)
Partitions the slice by some
SlicePartitioner that maps classes to names. |
<S extends PartitionSlice> |
partitionBy(SlicePartitioner partitioner,
PartitionSliceFactory<S> partitionSliceFactory)
Same as
Slice.partitionBy(SlicePartitioner) , but creates specialized subclasses
of PartitionSlice using a PartitionSliceFactory . |
SortedMap<String,PackageSlice> |
partitionByPackage()
Partitions the slice by package.
|
Slice |
plus(Iterable<? extends Slice> slices)
Creates a new slices as union from this slice and the slices passed.
|
Slice |
plus(Slice... slices)
Creates a new slices as union from this slice and the slices passed.
|
Slice |
slice(Iterable<? extends Slice> slices)
Creates a new slice that resembles the intersection of this slice and union of the
slices passed.
|
Slice |
slice(Predicate<Clazz> predicate)
Creates a new slices of all classes of this slide that fulfill the specified
name predicate.
|
Slice |
slice(Slice... slices)
Creates a new slice that resembles the intersection of this slice and the
slices passed.
|
Slice |
slice(String pattern)
Creates a new slices of all classes of this slide that match the specified
name pattern.
|
boolean |
uses(Slice other)
Check whether there is a dependency to some other slice.
|
protected abstract Slice getDelegate()
public Slice plus(Iterable<? extends Slice> slices)
Slice
public Slice plus(Slice... slices)
Slice
public Slice minus(Iterable<? extends Slice> slices)
Slice
public Slice minus(Slice... slices)
Slice
public Slice minus(String pattern)
Slice
this.minus(this.slice(pattern))
.public Slice minus(Predicate<Clazz> predicate)
Slice
this.minus(this.slice(predicate))
.public Slice slice(Iterable<? extends Slice> slices)
Slice
public Slice slice(Slice... slices)
Slice
public Slice slice(String pattern)
Slice
public Slice slice(Predicate<Clazz> predicate)
Slice
slice
in interface Slice
predicate
- the predicatefor predefined predicates
public Slice dependencyClosure(Slice within)
Slice
dependencyClosure
in interface Slice
within
- the slice within which the transitive closure is calculatedpublic boolean contains(Clazz entry)
Slice
public Set<Clazz> getClazzes()
Slice
Classpath
. A slice derived from some pattern or Predicate
will throw a ResolveException
instead.getClazzes
in interface Slice
public ConcreteSlice getDependencies()
Slice
getDependencies
in interface Slice
public boolean uses(Slice other)
Slice
public SortedMap<String,PackageSlice> partitionByPackage()
Slice
partitionByPackage
in interface Slice
public SortedMap<String,PartitionSlice> partitionBy(SlicePartitioner partitioner)
Slice
SlicePartitioner
that maps classes to names.
Clazzes the partitioner does not map to a name will be omitted form the result.partitionBy
in interface Slice
partitioner
- the SlicePartitioner
to partition byfor predefined partitioners
public <S extends PartitionSlice> SortedMap<String,S> partitionBy(SlicePartitioner partitioner, PartitionSliceFactory<S> partitionSliceFactory)
Slice
Slice.partitionBy(SlicePartitioner)
, but creates specialized subclasses
of PartitionSlice
using a PartitionSliceFactory
.partitionBy
in interface Slice
S
- the type of slices returnedpartitioner
- the SlicePartitioner
to partition bypartitionSliceFactory
- the factory to create the slicesCopyright © 2017–2023 Hans Jörg Heßmann. All rights reserved.