Class DescribeFrequencyMap<T extends Comparable<T>>
Object
com.owenfeehan.pathpatternfinder.describer.frequencymap.DescribeFrequencyMap<T>
- Type Parameters:
T
- element-type in frequency-map
public class DescribeFrequencyMap<T extends Comparable<T>> extends Object
Describes the contents of a frequency-map with user-friendly strings containing examples.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description DescribeFrequencyMap(FrequencyMap<T> frequencyMap)
Create for aFrequencyMap
. -
Method Summary
Modifier and Type Method Description boolean
canDescribeAllWithin(int width, int seperatorNumberChars)
Can all values be described within a certain width?String
describeAllWithin(int width, String prefix, String separator)
Describe all elements in the frequency-map in a string that must have maximumwidth
number of characters.int
numberUniqueValues()
How many unique-values are described in theFrequencyMap
?
-
Constructor Details
-
DescribeFrequencyMap
Create for aFrequencyMap
.- Parameters:
frequencyMap
- the frequency-map.
-
-
Method Details
-
numberUniqueValues
public int numberUniqueValues()How many unique-values are described in theFrequencyMap
?- Returns:
- a count of the unique-values
-
canDescribeAllWithin
public boolean canDescribeAllWithin(int width, int seperatorNumberChars)Can all values be described within a certain width?- Parameters:
width
- the maximum number-of-characters that values need to be described withinseperatorNumberChars
- the number of characters in the separator that is used between elements- Returns:
- true if all values can be described within
width
number of characters
-
describeAllWithin
Describe all elements in the frequency-map in a string that must have maximumwidth
number of characters.- Parameters:
width
- the maximum number-of-characters that values need to be described within.prefix
- a string to include immediately before the rest of the descriptionseparator
- a string to place between each element that is described- Returns:
- the summary string
-