public abstract class SiblingCounter extends Object
Constructor and Description |
---|
SiblingCounter() |
Modifier and Type | Method and Description |
---|---|
static SiblingCounter |
alter(SiblingCounter counter,
int delta)
Creates a sibling counter that alters another counter by a constant value.
|
static SiblingCounter |
constant(int count)
Create a sibling counter that always return the supplied count, regardless of the name or node.
|
abstract int |
countSiblingsNamed(Name childName)
Get the number of existing siblings that all have the supplied name.
|
static SiblingCounter |
create(CachedNode node,
NodeCache cache)
Creates a sibling counter that lazily obtains a
ChildReferences . |
static SiblingCounter |
create(ChildReferences childRefs)
Creates a sibling counter that uses the supplied
ChildReferences . |
static SiblingCounter |
noSiblings()
Create a sibling counter that always returns '0' for the number of same name siblings.
|
static SiblingCounter |
oneSibling()
Create a sibling counter that always returns '1' for the number of same name siblings.
|
public abstract int countSiblingsNamed(Name childName)
childName
- the name for the siblings; may not be nullpublic static SiblingCounter noSiblings()
public static SiblingCounter oneSibling()
public static SiblingCounter constant(int count)
count
- the count to be returned; may not be negativecount
; never nullpublic static SiblingCounter create(ChildReferences childRefs)
ChildReferences
.childRefs
- the child references; may not be nullpublic static SiblingCounter create(CachedNode node, NodeCache cache)
ChildReferences
.node
- the node; may not be nullcache
- the cache; may not be nullpublic static SiblingCounter alter(SiblingCounter counter, int delta)
counter
- the sibling counter; may not be nulldelta
- the positive or negative amount by which the counter
's value is alteredCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.