Package com.ibm.fhir.path
Class FHIRPathElementNode
- java.lang.Object
-
- com.ibm.fhir.path.FHIRPathAbstractNode
-
- com.ibm.fhir.path.FHIRPathElementNode
-
- All Implemented Interfaces:
FHIRPathNode
,java.lang.Comparable<FHIRPathNode>
- Direct Known Subclasses:
FHIRPathQuantityNode
public class FHIRPathElementNode extends FHIRPathAbstractNode
AFHIRPathNode
that wraps anElement
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FHIRPathElementNode.Builder
-
Field Summary
Fields Modifier and Type Field Description protected Element
element
protected FHIRPathTree
tree
-
Constructor Summary
Constructors Modifier Constructor Description protected
FHIRPathElementNode(FHIRPathElementNode.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(FHIRPathNodeVisitor visitor)
A method for accepting aFHIRPathNodeVisitor
FHIRPathQuantityNode
asQuantityNode()
Cast this FHIRPathElementNode to aFHIRPathQuantityNode
static FHIRPathElementNode.Builder
builder(Element element)
Static factory method for creating builder instances from anElement
int
compareTo(FHIRPathNode other)
Compare the element wrapped by this FHIRPathElementNode to the parameterElement
element()
TheElement
wrapped by this FHIRPathElementNodestatic FHIRPathElementNode
elementNode(Element element)
Static factory method for creating FHIRPathElementNode instances from anElement
static FHIRPathElementNode
elementNode(java.lang.String name, Element element)
Static factory method for creating named FHIRPathElementNode instances from anElement
boolean
equals(java.lang.Object obj)
Indicates whether this FHIRPathElementNode is equal to the parameterFHIRPathTree
getTree()
TheFHIRPathTree
that contains this FHIRPathElementNodeint
hashCode()
boolean
isComparableTo(FHIRPathNode other)
Indicates whether this FHIRPathElementNode has a primitive value and is comparable to the parameterboolean
isElementNode()
Indicates whether this FHIRPathNode is type compatible withFHIRPathElementNode
boolean
isQuantityNode()
Indicates whether this FHIRPathElementNode is type compatible withFHIRPathQuantityNode
FHIRPathElementNode.Builder
toBuilder()
Convert thisFHIRPathNode
instance into aFHIRPathNode.Builder
instancejava.lang.String
toString()
-
Methods inherited from class com.ibm.fhir.path.FHIRPathAbstractNode
as, children, descendants, getValue, hasValue, is, name, path, stream, type
-
Methods inherited from interface com.ibm.fhir.path.FHIRPathNode
asElementNode, asResourceNode, asSystemValue, asTermServiceNode, asTypeInfoNode, isResourceNode, isSystemValue, isTermServiceNode, isTypeInfoNode
-
-
-
-
Field Detail
-
element
protected final Element element
-
tree
protected final FHIRPathTree tree
-
-
Constructor Detail
-
FHIRPathElementNode
protected FHIRPathElementNode(FHIRPathElementNode.Builder builder)
-
-
Method Detail
-
element
public Element element()
TheElement
wrapped by this FHIRPathElementNode- Returns:
- the
Element
wrapped by this FHIRPathElementNode
-
getTree
public FHIRPathTree getTree()
TheFHIRPathTree
that contains this FHIRPathElementNode- Returns:
- the
FHIRPathTree
that contains this FHIRPathElementNode, otherwise null
-
isElementNode
public boolean isElementNode()
Description copied from interface:FHIRPathNode
Indicates whether this FHIRPathNode is type compatible withFHIRPathElementNode
- Returns:
- true if this FHIRPathNode is type compatible with
FHIRPathElementNode
, otherwise false
-
isQuantityNode
public boolean isQuantityNode()
Indicates whether this FHIRPathElementNode is type compatible withFHIRPathQuantityNode
- Returns:
- true if this FHIRPathElementNode is type compatible with
FHIRPathQuantityNode
, otherwise false
-
asQuantityNode
public FHIRPathQuantityNode asQuantityNode()
Cast this FHIRPathElementNode to aFHIRPathQuantityNode
- Returns:
- this FHIRPathElementNode as a
FHIRPathQuantityNode
-
elementNode
public static FHIRPathElementNode elementNode(Element element)
Static factory method for creating FHIRPathElementNode instances from anElement
- Parameters:
element
- the element- Returns:
- a new FHIRPathElementNode instance
-
elementNode
public static FHIRPathElementNode elementNode(java.lang.String name, Element element)
Static factory method for creating named FHIRPathElementNode instances from anElement
- Parameters:
name
- the nameelement
- the element- Returns:
- a new named FHIRPathElementNode instance
-
toBuilder
public FHIRPathElementNode.Builder toBuilder()
Description copied from class:FHIRPathAbstractNode
Convert thisFHIRPathNode
instance into aFHIRPathNode.Builder
instance- Specified by:
toBuilder
in classFHIRPathAbstractNode
- Returns:
- a new
FHIRPathNode.Builder
instance containing the fields from thisFHIRPathNode
instance
-
builder
public static FHIRPathElementNode.Builder builder(Element element)
Static factory method for creating builder instances from anElement
- Parameters:
element
- the element- Returns:
- a new builder for building FHIRPathElementNode instances
-
isComparableTo
public boolean isComparableTo(FHIRPathNode other)
Indicates whether this FHIRPathElementNode has a primitive value and is comparable to the parameter- Parameters:
other
- the otherFHIRPathNode
- Returns:
- true if this FHIRPathElementNode has a primitive value and is comparable to the primitive value of the parameter, otherwise false
-
compareTo
public int compareTo(FHIRPathNode other)
Compare the element wrapped by this FHIRPathElementNode to the parameter- Parameters:
other
- the otherFHIRPathNode
- Returns:
- the result of comparing the primitive value of this FHIRPathElementNode to the primitive value of the parameter
-
equals
public boolean equals(java.lang.Object obj)
Indicates whether this FHIRPathElementNode is equal to the parameter- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the otherObject
- Returns:
- true if the primitive value of this FHIRPathElementNode is equal to the primitive value of the parameter or the
Element
wrapped by this FHIRPathElementNode is equal to theElement
wrapped by the parameter, otherwise false
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
accept
public void accept(FHIRPathNodeVisitor visitor)
Description copied from interface:FHIRPathNode
A method for accepting aFHIRPathNodeVisitor
- Parameters:
visitor
- theFHIRPathNodeVisitor
that this FHIRPathNode is accepting
-
-