ReteTree

interface ReteTree: Any

Fields

Name Description
abstract isOrdered: Boolean

Checks if the values this ReteTree produces are to be considered as order-sensitive

abstract clauses: Sequence<Clause>

Returns all the Clause this ReteTree is storing

open size: Int

Returns the number of Clause stored in this tree

Methods

get

abstract fun get(clause: Clause): Sequence<Clause>

Reads all the clauses matching the given Clause

Parameters

Name Description
clause: Clause

ReturnValue

Name Description
Sequence<Clause>

contains

open operator fun contains(clause: Clause): Boolean

Tells if the given Clause is stored in this ReteTree

Parameters

Name Description
clause: Clause

ReturnValue

Name Description
Boolean

assertA

abstract fun assertA(clause: Clause)

Tries to insert the given Clause as the first occurrence of its own family

Parameters

Name Description
clause: Clause

ReturnValue

Name Description
Unit

assertZ

abstract fun assertZ(clause: Clause)

Insert the given Clause as the first occurrence of its own family

Parameters

Name Description
clause: Clause

ReturnValue

Name Description
Unit

retractFirst

abstract fun retractFirst(clause: Clause): Sequence<Clause>

Retract the first occurrence of the given Clause from this ReteTree. The meaning of "first" may vary between implementations

Parameters

Name Description
clause: Clause

ReturnValue

Name Description
Sequence<Clause>

retractOnly

abstract fun retractOnly(clause: Clause, limit: Int): Sequence<Clause>

Retracts only the given number of matching clauses from this ReteTree

Parameters

Name Description
clause: Clause
limit: Int

ReturnValue

Name Description
Sequence<Clause>

retractAll

abstract fun retractAll(clause: Clause): Sequence<Clause>

Retracts all the matching clauses from this ReteTree

Parameters

Name Description
clause: Clause

ReturnValue

Name Description
Sequence<Clause>

deepCopy

abstract fun deepCopy(): ReteTree

Produces a fully instantiated complete copy of this ReteTree

ReturnValue

Name Description
ReteTree

CompanionObject

ReteTree

interface ReteTree: Any

Methods

emptyUnordered

fun emptyUnordered(): ReteTree

Creates an empty unordered ReteTree

ReturnValue

Name Description
ReteTree

unordered

fun unordered(clauses: Iterable<Clause>): ReteTree

Creates an unordered ReteTree based on the given Iterable

Parameters

Name Description
clauses: Iterable<Clause>

ReturnValue

Name Description
ReteTree

unordered

fun unordered(vararg clauses: Clause): ReteTree

Creates an unordered ReteTree based on the given vararg

Parameters

Name Description
vararg clauses: Clause

ReturnValue

Name Description
ReteTree

emptyOrdered

fun emptyOrdered(): ReteTree

Creates an empty ordered ReteTree

ReturnValue

Name Description
ReteTree

ordered

fun ordered(clauses: Iterable<Clause>): ReteTree

Creates an ordered ReteTree based on the given Iterable

Parameters

Name Description
clauses: Iterable<Clause>

ReturnValue

Name Description
ReteTree

ordered

fun ordered(vararg clauses: Clause): ReteTree

Creates an ordered ReteTree based on the given vararg

Parameters

Name Description
vararg clauses: Clause

ReturnValue

Name Description
ReteTree