public interface Slice
Clazz
.
A Slice is immutable in behaviour. It may use deferred evaluation or caching, but each method (incl. toString())
must produce the same result in any circumstance.
Two different Slice instances are never equal, even if they represent the same set of classes.Modifier and Type | Method and Description |
---|---|
boolean |
contains(Clazz clazz)
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.
|
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
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.
|
Slice plus(Iterable<? extends Slice> slices)
slices
- the slices for the unionSlice plus(Slice... slices)
slices
- the slices for the unionSlice minus(Iterable<? extends Slice> slices)
slices
- the slices to create the difference fromSlice minus(Slice... slices)
slices
- the slices to create the difference fromSlice minus(String pattern)
this.minus(this.slice(pattern))
.pattern
- the pattern for the slice to subtract from this sliceSlice minus(Predicate<Clazz> predicate)
this.minus(this.slice(predicate))
.predicate
- the pattern for the slice to subtract from this sliceSlice slice(Iterable<? extends Slice> slices)
slices
- the slices to create the intersection fromSlice slice(Slice... slices)
slices
- the slices to create the intersection fromSlice slice(String pattern)
pattern
- the patternSlice slice(Predicate<Clazz> predicate)
predicate
- the predicatefor predefined predicates
Slice dependencyClosure(Slice within)
within
- the slice within which the transitive closure is calculatedboolean contains(Clazz clazz)
clazz
- the ClazzSet<Clazz> getClazzes()
Classpath
. A slice derived from some pattern or Predicate
will throw a ResolveException
instead.ResolveException
- if the classes cannot be determinedConcreteSlice getDependencies()
boolean uses(Slice other)
other
- the other sliceSortedMap<String,PackageSlice> partitionByPackage()
SortedMap<String,PartitionSlice> partitionBy(SlicePartitioner partitioner)
SlicePartitioner
that maps classes to names.
Clazzes the partitioner does not map to a name will be omitted form the result.partitioner
- the SlicePartitioner
to partition byfor predefined partitioners
<S extends PartitionSlice> SortedMap<String,S> partitionBy(SlicePartitioner partitioner, PartitionSliceFactory<S> partitionSliceFactory)
partitionBy(SlicePartitioner)
, but creates specialized subclasses
of PartitionSlice
using a PartitionSliceFactory
.S
- the type of slices returnedpartitioner
- the SlicePartitioner
to partition bypartitionSliceFactory
- the factory to create the slicesSlice named(String name)
Slice
from this slice for which the
Object.toString()
returns name.name
- the name of this sliceCopyright © 2017–2023 Hans Jörg Heßmann. All rights reserved.