OSFI-Java  3.9.2
OpenSF Integration Library
esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S > Class Template Referenceabstract

Classes

class  Parsed
 
class  Raw
 

Public Member Functions

 ArrayNode (V values)
 
 ArrayNode (List<? extends S > subNodes)
 
final boolean isDataNode ()
 
getData ()
 
final List< S > getSubNodes ()
 
final S getSubNodeAt (final int... indices)
 
final V getDataAtSub (final int... indices)
 
final int getDim ()
 
final List< Integer > getDimsEnvelope ()
 
String toString ()
 
boolean equals (Object other)
 
int hashCode ()
 

Protected Member Functions

abstract int getDataDim ()
 
boolean dataEquals (ArrayNode<?, ?> other)
 
int dataHashCode ()
 
abstract String dataToStr ()
 

Protected Attributes

final V elems
 

Detailed Description

Class that represents a tree with data (leaf) nodes and internal nodes. The data may be raw (a String with the unparsed values) or fully parsed.

Parameters
<V>Type used to store values. May be an array for parsed nodes, or a String for unparsed.
<S>CRTP parameter, used so that getSubNodes() and similar return the same type.
See also
ArrayNode.Raw Class representing unparsed array nodes.

Constructor & Destructor Documentation

◆ ArrayNode() [1/2]

esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.ArrayNode ( values)

Create a data node with the given values.

◆ ArrayNode() [2/2]

esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.ArrayNode ( List<? extends S >  subNodes)

Create an internal node with the given subnodes.

Member Function Documentation

◆ dataEquals()

boolean esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.dataEquals ( ArrayNode<?, ?>  other)
protected

Comparison of data values, override if more fields need to be compared.

◆ dataHashCode()

int esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.dataHashCode ( )
protected

Hash code of data values, override if more fields need to be considered.

◆ dataToStr()

abstract String esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.dataToStr ( )
abstractprotected

String version of the data elements.

◆ equals()

boolean esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.equals ( Object  other)
Returns
true if the data/subnodes of this node match those on other for a data/internal node respectively.

◆ getData()

V esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.getData ( )

Returns the raw data elements, or null if this is an internal node without data.

◆ getDataAtSub()

final V esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.getDataAtSub ( final int...  indices)

Return the data at the given index position in the tree. Equivalent to

getSubNodeAt(indices).getData()

, except in the case that indices is empty, in which this method does return the result of calling getData() on this instead of throwing.

Parameters
indicesIndex values for each dimension.
See also
getData()
getSubNodeAt(int...)

◆ getDataDim()

abstract int esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.getDataDim ( )
abstractprotected

For data nodes, return the size of the data elements.

◆ getDim()

final int esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.getDim ( )

Get the size of this array node (i.e. of this dimension level).

◆ getDimsEnvelope()

final List<Integer> esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.getDimsEnvelope ( )

Compute the rectangular envelope for the dimensions of this array node, considering all nodes below it in the tree.

◆ getSubNodeAt()

final S esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.getSubNodeAt ( final int...  indices)

Return the subnode at the given index position in the tree. Equivalent to calling

s = s.getSubNodes().get(i)

for each index given, with s initially equal to this object. The final s value is returned.

Parameters
indicesIndex values for each dimension.

◆ getSubNodes()

final List<S> esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.getSubNodes ( )

Returns the list of subnodes, or the empty list if this is a data node without subnodes.

◆ hashCode()

int esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.hashCode ( )

◆ isDataNode()

final boolean esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.isDataNode ( )

Returns true if this node was built with data elements, false if it was built with subnodes.

◆ toString()

String esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.toString ( )

Return a user-understandable representation of the tree, useful for debugging.

Member Data Documentation

◆ elems

final V esa.opensf.osfi.ArrayNode< V, S extends ArrayNode< V, S >.elems
protected

Elements for a data node. If null, this is an internal node.


The documentation for this class was generated from the following file:
esa.opensf.osfi.ArrayNode.getSubNodeAt
final S getSubNodeAt(final int... indices)
Definition: ArrayNode.java:67