Struct amfnengine::core::list_event::ListEvent [−]
Implementations
impl ListEvent
List of events implementation.
pub fn new(cashflow_param: bool) -> ListEvent
Create and return a new list event element.
Arguments
cashflow_param
- Originated from cashflow.
Return
- See description.
pub fn add_event(
&mut self,
event_date_param: usize,
date_expr_param: &str,
sort_order_param: usize,
value_param: Decimal,
value_expr_param: &str,
value_expr_balance_param: bool,
periods_param: usize,
periods_expr_param: &str,
skip_mask_len_param: usize,
skip_mask_param: u128,
intervals_param: usize,
frequency_param: FrequencyType,
elem_extension_param: ElemExtension,
list_parameter_param: Option<ListParameter>,
list_descriptor_param: Option<ListDescriptor>,
event_name_param: &str,
next_name_param: &str
) -> bool
&mut self,
event_date_param: usize,
date_expr_param: &str,
sort_order_param: usize,
value_param: Decimal,
value_expr_param: &str,
value_expr_balance_param: bool,
periods_param: usize,
periods_expr_param: &str,
skip_mask_len_param: usize,
skip_mask_param: u128,
intervals_param: usize,
frequency_param: FrequencyType,
elem_extension_param: ElemExtension,
list_parameter_param: Option<ListParameter>,
list_descriptor_param: Option<ListDescriptor>,
event_name_param: &str,
next_name_param: &str
) -> bool
Add a new event into the event list.
Arguments
event_type_param
- Event type.event_date_param
- Event date.date_expr_param
- Date expression.sort_order_param
- Sort order.value_param
- Value parameter.value_expr_param
- Value expression parameter.value_expr_balance_param
- Value expression balance.periods_param
- Periods parameter.periods_expr_param
- Periods expression.skip_mask_len_param
- Skip mask length.skip_mask_param
- Skip mask.intervals_param
- Intervals parameter.frequency_param
- Frequency parameter.extension_param
- Extension (current value, interest change, principal change, statistic value).list_parameter_param
- List parameter.list_descriptor_param
- List descriptor.event_name_param
- Optional event name.next_name_param
- Optional next event name.
Return
- True if successful, otherwise false.
pub fn copy(&self, updating_json_param: bool) -> ListEvent
Performs a deep copy of this event list and return a new event list.
Arguments
updating_json_param
- Updating from json.
Return
- See description.
pub fn copy_list_event(
&self,
list_event: &mut ListEvent,
updating_json_param: bool
) -> Result<(), ErrorType>
&self,
list_event: &mut ListEvent,
updating_json_param: bool
) -> Result<(), ErrorType>
Performs a deep copy of this event list into the event list parameter.
Arguments
list_event
- The event list to copy into.updating_json_param
- Updating from json.
Return
- ERROR_NONE if successful.
pub fn copy_list_event_selected(
&self,
list_event: &mut ListEvent,
count: i32,
updating_json_param: bool
) -> Result<(), ErrorType>
&self,
list_event: &mut ListEvent,
count: i32,
updating_json_param: bool
) -> Result<(), ErrorType>
Performs a deep copy of selected events. Copies selected events from this event list into the event list parameter.
Arguments
list_event
- The event list to copy into.count
- The direction (i.e., positive or negative) and the number of events to copy. as they are copied.updating_json_param
- Updating from json.
Return
- ERROR_NONE if successful.
pub fn copy_event(
&self,
list_event: &mut ListEvent,
index: usize,
updating_json_param: bool
) -> Result<(), ErrorType>
&self,
list_event: &mut ListEvent,
index: usize,
updating_json_param: bool
) -> Result<(), ErrorType>
Performs a deep copy of the event index into the event list parameter.
Arguments
list_event
- The event list to copy into.index
- The event index to copy.updating_json_param
- Updating from json.
Return
- ERROR_NONE if successful.
pub fn cashflow(&self) -> bool
pub fn list(&self) -> &Vec<ElemEvent>
pub fn list_mut(&mut self) -> &mut Vec<ElemEvent>
pub fn eom(&self) -> bool
pub fn elem_type(&self) -> ExtensionType
pub fn event_type(&self) -> &str
pub fn event_date(&self) -> usize
pub fn date_expr(&self) -> &str
pub fn sort_order(&self) -> usize
pub fn value(&self) -> Decimal
pub fn value_expr(&self) -> &str
Get the optional value expression evaluated when the event list is amortization or balanced.
Return
- See description.
pub fn value_expr_balance(&self) -> bool
Get the expression is evalulated when balanced, otherwise when amortization.
Return
- See description.
pub fn periods(&self) -> usize
pub fn periods_expr(&self) -> &str
Get the optional periods expression evaluated when the event list is amortization.
Return
- See description.
pub fn skip_mask_len(&self) -> usize
Get the optional length of the periods to skip when the event list is amortization.
Return
- See description.
pub fn skip_mask(&self) -> u128
pub fn intervals(&self) -> usize
pub fn frequency(&self) -> FrequencyType
pub fn elem_extension(&self) -> &ElemExtension
pub fn list_parameter(&self) -> Option<&ListParameter>
pub fn list_descriptor(&self) -> Option<&ListDescriptor>
pub fn event_name(&self) -> &str
pub fn next_name(&self) -> &str
pub fn get_element_by_name(
&self,
name_param: &str,
is_select_param: bool
) -> bool
&self,
name_param: &str,
is_select_param: bool
) -> bool
Select an event based upon an event name.
Arguments
name_param
- The event name to select.is_select_param
- Select If true select element, otherwise restore current element.
Return
- True if successful, otherwise false.
pub fn get_element_by_stat_name(
&self,
stat_name_param: &str,
is_select_param: bool
) -> bool
&self,
stat_name_param: &str,
is_select_param: bool
) -> bool
Select an event based upon a statistic value name.
Arguments
stat_name_param
- The statistic value name to select.is_select_param
- If true select element, otherwise restore current element.
Return
- True if successful, otherwise false.
pub fn get_element_by_type(
&self,
extension_type_param: ExtensionType,
iteration_param: usize
) -> bool
&self,
extension_type_param: ExtensionType,
iteration_param: usize
) -> bool
Select an event based upon the extension type.
Arguments
extension_type_param
- The extension type to select.iteration
- Select the nth iteration of the extension type.
Return
- True if successful, otherwise false.
pub fn remove(&mut self) -> bool
pub fn set_event_type(&mut self, event_type_param: &str) -> bool
Set the event type information.
Arguments
event_type_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_event_date(&mut self, event_date_param: usize) -> bool
Set the constant date of the event in YYYYMMDD format (major sort key).
Arguments
event_date_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_date_result(&self, event_date_param: usize) -> bool
Set the expression date of the event in YYYYMMDD format (major sort key).
Arguments
event_date_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_date_expr(&mut self, date_expr_param: &str) -> bool
Set the optional date expression evaluated when created from a template.
Arguments
date_expr_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_sort_order(&mut self, sort_order_param: usize) -> bool
Set the sort order within the event date (minor sort key).
Arguments
sort_order_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_value(&self, value_param: Decimal) -> bool
Set the constant value.
Arguments
value_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_value_result(&self, value_param: Decimal) -> bool
Set the value result of an expression.
Arguments
value_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_value_expr(&mut self, value_expr_param: &str) -> bool
Set the optional value expression evaluated when the event list is amortization or balanced.
Arguments
value_expr_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_value_expr_result(&mut self, value_expr_param: &str) -> bool
Set the value expression result.
Arguments
value_expr_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_value_expr_balance(&mut self, value_expr_balance_param: bool) -> bool
Set the expression is evalulated when balanced, otherwise when amortization.
Arguments
value_expr_balance_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_periods(&self, periods_param: usize) -> bool
Set the constant periods.
Arguments
periods_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_periods_result(&self, periods_param: usize) -> bool
Set the periods result of an expression.
Arguments
periods_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_periods_expr(&mut self, periods_expr_param: &str) -> bool
Set the optional periods expression evaluated when the event list is amortization.
Arguments
periods_expr_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_periods_expr_result(&mut self, periods_expr_param: &str) -> bool
Set the periods expression result.
Arguments
periods_expr_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_skip_mask(
&self,
skip_mask_len_param: usize,
skip_mask_param: u128
) -> bool
&self,
skip_mask_len_param: usize,
skip_mask_param: u128
) -> bool
Set the optional periods to skip when the event list is amortization.
Arguments
skip_mask_len_param
- Skip mask length.skip_mask_param
- Skip mask.
Return
- True if successful, otherwise false.
pub fn set_intervals(&mut self, intervals_param: usize) -> bool
Set the optional intervals of frequency between periods.
Arguments
intervals_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_frequency(&mut self, frequency_param: FrequencyType) -> bool
Set the frequency of the event.
Arguments
frequency_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_frequency_result(&mut self, frequency_param: FrequencyType) -> bool
Set the frequency of the event.
Arguments
frequency_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_principal_change(
&mut self,
principal_change_param: ElemPrincipalChange
) -> bool
&mut self,
principal_change_param: ElemPrincipalChange
) -> bool
Set the ElemPrincipalChange object.
Arguments
principal_change_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_current_value(
&mut self,
current_value_param: ElemCurrentValue
) -> bool
&mut self,
current_value_param: ElemCurrentValue
) -> bool
Set the ElemCurrentValue object.
Arguments
current_value_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_interest_change(
&mut self,
interest_change_param: ElemInterestChange
) -> bool
&mut self,
interest_change_param: ElemInterestChange
) -> bool
Set the ElemInterestChange object.
Arguments
interest_change_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_statistic_value(
&mut self,
statistic_value_param: ElemStatisticValue
) -> bool
&mut self,
statistic_value_param: ElemStatisticValue
) -> bool
Set the ElemStatisticValue object.
Arguments
statistic_value_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_event_name(&mut self, event_name_param: &str) -> bool
Set the optional event name.
Arguments
event_name_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_next_name(&mut self, next_name_param: &str) -> bool
Set the optional next name of the template.
Arguments
next_name_param
- See description.
Return
- True if successful, otherwise false.
pub fn set_sort_on_add(&mut self, sort_on_add_param: bool) -> bool
Determines when the event list is sorted.
Arguments
sort_on_add_param
- If true sort when an event is added, otherwise do not sort (for bulk adds).
pub fn set_sort_updated(&self, sort_updated_param: bool) -> bool
Trait Implementations
impl ListTrait for ListEvent
List of events list implementation.
fn clear(&mut self)
Clear all events from the event list.
fn count(&self) -> usize
fn index(&self) -> usize
fn get_element(&self, index_param: usize) -> bool
Select an event based upon an index value.
Arguments
index_param
- The index value of the event to select (starting from 0).
Return
- True if successful, otherwise false.
fn set_index(&self, index_param: usize) -> bool
Auto Trait Implementations
impl !RefUnwindSafe for ListEvent
impl Send for ListEvent
impl !Sync for ListEvent
impl Unpin for ListEvent
impl UnwindSafe for ListEvent
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,