Skip to content

DsChain

Hyomoto edited this page Dec 12, 2020 · 14 revisions
Jump To Go Back Arguments Methods Variables

DsChain()

Implements: None

inheritable template, provides a standardized interface for dealing with linked / data structures

// no example

Arguments

Name Type Purpose
None

Methods

Jump To top ChainLink clear empty size copy toArray toString is

ChainLink( value )

Returns: ChainLink

Name Type Purpose
value mixed The value to store

A structure for holding and linking values as part of a DsChain.


clear()

Returns: N/A undefined

Name Type Purpose
None

Clears the chain, removing all links.


empty()

Returns: boolean (true or false)

Name Type Purpose
None

Returns true if the structure has no links.


size()

Returns: N/A undefined

Name Type Purpose
None

Returns the number of links in the structure.


copy( the, the, the )

Returns: N/A undefined

Name Type Purpose
the Struct structure that will be copied to, or undefined if a new one should be created
the constructor type of structure that should be created if one isn't provided
the string function that should be called to populate the new structure

Returns a copy of this DsChain, or copies to target if provided. / #returns struct


toArray()

Returns: array ([values...])

Name Type Purpose
None

Returns the structure as a array.


toString( divider )

Returns: string ("string")

Name Type Purpose
divider string optional: The divider between each element. Default: ", "

Returns a comma-separated string(by default) of all values in the array.


is( type )

Returns: boolean (true or false)

Name Type Purpose
type Constructor The Constructor to compare this against.

Returns true if the provided type is DsChain.


Variables

Jump To top
  • chain - the first link the chain
  • links - the number of links in the chain
Clone this wiki locally