Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Entry

Returned through JSONPointerMap.getEntry and iterators.

Following a sequence of put operations, all entries will have a value, or children, or both. Through the Entry.removeDescendants method, it is possible for an entry to have neither a value nor children.

Hierarchy

  • Entry

Index

Constructors

constructor

  • Parameters

    • segment: Segment | null

      the segment of the entry, null if the entry is the root entry

    • pointer: JSONPointer

      the pointer to the location if the entry

    • context: JSONPointerMap

      the map that this entry belongs to

    Returns Entry

Properties

children

children: Entry[]

The child entries

Readonly context

The map that this entry belongs to

Readonly pointer

pointer: JSONPointer

The pointer to the location if the entry

Readonly segment

segment: Segment | null

The segment of the entry

value

value: any

The value attached to the entry

Methods

addChild

  • Add a child entry

    Parameters

    • s: Segment

      the segment of the new entry, relative to this entry's segment

    Returns Entry

    the newly created child

count

  • count(): number
  • Recursively count the number of entries in the tree

    Returns number

    the number of entries that contain a value

findChild

  • Find an immediate child by the segment

    Parameters

    • s: Segment

      the segment to search for

    Returns Entry | null

    the child that matches the segment, null if not child was found

numberOfChildren

  • numberOfChildren(): number
  • Calculate the number of direct children that contain a value

    Returns number

    the number of children with a value

removeDescendants

  • removeDescendants(): number
  • Remove all descendants of the entry

    Returns number

    the total number of removed descendants that contained a value

setValue

  • setValue(newValue: any): any
  • Set the value of the entry

    Parameters

    • newValue: any

      the new value of the entry

    Returns any

    the old value of the entry

toString

  • toString(): string
  • Convert the entry to a string

    Returns string

    a string representation of the entry

Copyright © 2025 DiffusionData Ltd. All Rights Reserved.