Package com.cobber.fta
Class Shapes
- java.lang.Object
-
- com.cobber.fta.Shapes
-
public class Shapes extends java.lang.Object
Class used to manage Shapes.
-
-
Constructor Summary
Constructors Constructor Description Shapes(int maxShapes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map.Entry<java.lang.String,java.lang.Long>
getBest()
Get the 'best' shape - where 'best' is the one with the highest count.java.lang.String
getRegExp()
Get the 'best' Regular Expression we can based on the set of shapes.java.util.Map<java.lang.String,java.lang.Long>
getShapes()
Get the Map of shapes.int
size()
Get the size of the Map.void
track(java.lang.String trimmed, long count)
Track the supplied shape.
-
-
-
Method Detail
-
getRegExp
public java.lang.String getRegExp()
Get the 'best' Regular Expression we can based on the set of shapes.- Returns:
- The 'best' Regular Expression we can based on the set of shapes, or null if nothing clever can be discerned.
-
track
public void track(java.lang.String trimmed, long count)
Track the supplied shape.- Parameters:
trimmed
- Track the supplied shape.count
- The count of the supplied shape.
-
getBest
public java.util.Map.Entry<java.lang.String,java.lang.Long> getBest()
Get the 'best' shape - where 'best' is the one with the highest count.- Returns:
- The 'best' shape entry (shape and count).
-
getShapes
public java.util.Map<java.lang.String,java.lang.Long> getShapes()
Get the Map of shapes.- Returns:
- The ordered (by shape) Map of all shapes.
-
size
public int size()
Get the size of the Map.- Returns:
- The Map size.
-
-