Operation class
/// An Operation class that stores predefined or commonly used account movements.
The class provides a batch operation interface to create multiple journal entries
(represented as JrlLine
objects) that can later be executed in bulk.
- Mixed-in types
Constructors
- Operation(dynamic book, {dynamic name, dynamic date, dynamic cplus, dynamic cminus, dynamic desc, dynamic cur, dynamic valuta, dynamic mod})
- Constructor to initialize the operation.
Properties
- book ↔ Book
-
getter/setter pair
-
cminus
↔ List<
String> -
Name of the operation (e.g., a tag to identify the operation).
getter/setter pair
-
cplus
↔ List<
String> -
Name of the operation (e.g., a tag to identify the operation).
getter/setter pair
-
cur
↔ List<
String> -
Name of the operation (e.g., a tag to identify the operation).
getter/setter pair
-
datum
↔ List<
DateTime> -
The book to which the operation is tied.
getter/setter pair
-
desc
↔ List<
String> -
Name of the operation (e.g., a tag to identify the operation).
getter/setter pair
-
expressions
↔ Map<
String, dynamic> -
Map of variables used in the operation for templating and expressions.
getter/setter pair
- first → JrlLine
-
The first element.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether this collection has no elements.
no setterinherited
- isNotEmpty → bool
-
Whether this collection has at least one element.
no setterinherited
-
iterator
→ Iterator<
JrlLine> -
creates an iterable object so we can do a forEach on it
no setteroverride
- last → JrlLine
-
The last element.
no setterinherited
- length → int
-
letting opshandler look like an array,Returns the length of prepared journal lines.
no setteroverride
-
mod
↔ List<
String> -
Name of the operation (e.g., a tag to identify the operation).
getter/setter pair
- name ↔ String
-
List of dates associated with the operation entries.
getter/setter pair
-
preparedLines
↔ List<
JrlLine> -
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- single → JrlLine
-
Checks that this iterable has only one element, and returns that element.
no setterinherited
-
valuta
↔ List<
String> -
Name of the operation (e.g., a tag to identify the operation).
getter/setter pair
-
vars
↔ Map<
String, dynamic> -
List of prepared journal lines that can be executed.
getter/setter pair
Methods
-
add(
{dynamic date, dynamic cplus, dynamic cminus, dynamic desc, dynamic cur, dynamic valuta, dynamic mod}) → Operation - batch setterr Adds a batch of attributes to the operation (e.g., date, account, description, etc.).
-
any(
bool test(JrlLine element)) → bool -
Checks whether any element of this iterable satisfies
test
.inherited -
asList(
List< List> data) → void - return a list abstraction model of this object . Converts the operation into a list format, suitable for CSV or other structured outputs.
-
cast<
R> () → Iterable< R> -
A view of this iterable as an iterable of
R
instances.inherited -
contains(
Object? element) → bool -
Whether the collection contains an element equal to
element
.inherited -
elementAt(
int index) → JrlLine -
Returns the
index
th element.inherited -
eval(
{String key = "", Expression? exp}) → dynamic -
Evaluates an expression using the current variables.
If
exp
is provided, it evaluates that specific expression, otherwise it uses thekey
to look up an expression.d to extract variables from thevaluta
field. -
every(
bool test(JrlLine element)) → bool -
Checks whether every element of this iterable satisfies
test
.inherited -
expand<
T> (Iterable< T> toElements(JrlLine element)) → Iterable<T> -
Expands each element of this Iterable into zero or more elements.
inherited
-
firstWhere(
bool test(JrlLine element), {JrlLine orElse()?}) → JrlLine -
The first element that satisfies the given predicate
test
.inherited -
fold<
T> (T initialValue, T combine(T previousValue, JrlLine element)) → T -
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
inherited
-
followedBy(
Iterable< JrlLine> other) → Iterable<JrlLine> -
Creates the lazy concatenation of this iterable and
other
.inherited -
forEach(
void action(JrlLine element)) → void -
Invokes
action
on each element of this iterable in iteration order.inherited -
join(
[String separator = ""]) → String -
Converts each element to a String and concatenates the strings.
inherited
-
lastWhere(
bool test(JrlLine element), {JrlLine orElse()?}) → JrlLine -
The last element that satisfies the given predicate
test
.inherited -
map<
T> (T toElement(JrlLine e)) → Iterable< T> -
The current elements of this iterable modified by
toElement
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseExpression(
JrlLine line, String source, RegExp expPresent) → void -
Helper method to extract variables from the description.
Helper method to extract variables from the
valuta
field. check if it can be evaluated with expressions: ^0.2.3: Parses expressions within the description or valuta fields. These expressions are stored inexpressions
and evaluated later. -
parseExpression2(
JrlLine line, String source) → void -
prepare(
) → void -
Prepares the operation by converting attributes into
JrlLine
objects. This method sets up constraints, evaluates expressions, and fills in variables where necessary. -
reduce(
JrlLine combine(JrlLine value, JrlLine element)) → JrlLine -
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
inherited
-
result(
) → List< JrlLine> -
Returns the list of
JrlLine
entries that have a validvaluta
value. -
singleWhere(
bool test(JrlLine element), {JrlLine orElse()?}) → JrlLine -
The single element that satisfies
test
.inherited -
skip(
int count) → Iterable< JrlLine> -
Creates an Iterable that provides all but the first
count
elements.inherited -
skipWhile(
bool test(JrlLine value)) → Iterable< JrlLine> -
Creates an
Iterable
that skips leading elements whiletest
is satisfied.inherited -
take(
int count) → Iterable< JrlLine> -
Creates a lazy iterable of the
count
first elements of this iterable.inherited -
takeWhile(
bool test(JrlLine value)) → Iterable< JrlLine> -
Creates a lazy iterable of the leading elements satisfying
test
.inherited -
toList(
{bool growable = true}) → List< JrlLine> -
Creates a List containing the elements of this Iterable.
inherited
-
toSet(
) → Set< JrlLine> -
Creates a Set containing the same elements as this iterable.
inherited
-
toString(
) → String -
Returns a string representation of the operation.
Formats the entries in a human-readable format, listing each attribute.
override
-
undo(
) → void -
validate(
) → bool -
where(
bool test(JrlLine element)) → Iterable< JrlLine> -
Creates a new lazy Iterable with all elements that satisfy the
predicate
test
.inherited -
whereType<
T> () → Iterable< T> -
Creates a new lazy Iterable with all elements that have type
T
.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int i) → dynamic -
Getter to access individual
JrlLine
entries inpreparedLines
by index. Replaces template variables in descriptions and evaluates expressions if any. -
operator []=(
int i, JrlLine value) → void -
Setter to access individual
JrlLine
entries inpreparedLines
by index.