public class AffixSiblingSetRule extends Object implements SiblingSetRule
SiblingSetPattern from siblings sharing a fixed prefix/suffix around a varying
dynamic segment — for example item-1, item-2, item-3
collapse to item-*.
Sibling names are first bucketed by their leading text up to the first separator run
(-, _, ., space). Within each large-enough bucket, the
longest common prefix and suffix are backed off to successively shorter separator (and
letter-to-digit) boundaries — shortest first, favoring the most general pattern — until every
middle segment is non-empty and classified as dynamic by a single segment
rule (default: StandardNodeNameRule; add a DateTimeNodeNameRule to derive
patterns like report-* from report-2024-01-15,
report-2024-01-16). Patterns whose affixes are empty after trimming separators are
rejected — entirely dynamic names are the build-time rules' job.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MINIMUM_SIBLINGS |
| Constructor and Description |
|---|
AffixSiblingSetRule() |
| Modifier and Type | Method and Description |
|---|---|
AffixSiblingSetRule |
addSegmentRule(NodeNameRule segmentRule) |
AffixSiblingSetRule |
clearSegmentRules() |
SiblingSetPattern |
derivePattern(TreeNode parent,
List<TreeNode> candidateSiblings) |
int |
getMinimumSiblings() |
List<NodeNameRule> |
getSegmentRules() |
AffixSiblingSetRule |
setMinimumSiblings(int minimumSiblings)
Sets the minimum number of pattern-sharing siblings required to derive a pattern (default
3, at least 2).
|
public static final int DEFAULT_MINIMUM_SIBLINGS
public int getMinimumSiblings()
public AffixSiblingSetRule setMinimumSiblings(int minimumSiblings)
public List<NodeNameRule> getSegmentRules()
public AffixSiblingSetRule addSegmentRule(NodeNameRule segmentRule)
public AffixSiblingSetRule clearSegmentRules()
public SiblingSetPattern derivePattern(TreeNode parent, List<TreeNode> candidateSiblings)
derivePattern in interface SiblingSetRuleCopyright (c) 2006-2026 North Concepts Inc. All Rights Reserved.