public interface Accountancy
Accountancy
interface is implemented by classes offering a basic accounting service. Generally, an
Accountancy
aggregates objects of the type AccountancyEntry
and subclasses thereof. Additionally, an
Accountancy
offers methods for querying of entries and financial statistics.Modifier and Type | Method and Description |
---|---|
<T extends AccountancyEntry> |
add(T accountancyEntry)
Adds a new
AccountancyEntry to this Accountancy . |
Streamable<AccountancyEntry> |
find(Interval interval)
Returns all
AccountancyEntry s that were created in the given Interval . |
Map<Interval,Streamable<AccountancyEntry>> |
find(Interval interval,
TemporalAmount duration)
|
Streamable<AccountancyEntry> |
findAll()
Returns all
AccountancyEntry s of the specified type clazz and all sub-types, previously added to
the accountancy. |
Optional<AccountancyEntry> |
get(AccountancyEntryIdentifier accountancyEntryIdentifier)
Returns the
AccountancyEntry of type clazz and all sub-types, identified by
AccountancyEntryIdentifier . |
Map<Interval,javax.money.MonetaryAmount> |
salesVolume(Interval interval,
TemporalAmount duration)
Returns the sum of the field
amount of all AccountancyEntry s which have their date within
(including) from and to . |
<T extends AccountancyEntry> T add(T accountancyEntry)
AccountancyEntry
to this Accountancy
.accountancyEntry
- entry to be added to the accountancyStreamable<AccountancyEntry> findAll()
AccountancyEntry
s of the specified type clazz
and all sub-types, previously added to
the accountancy. If no entries of the specified type exist, an empty Iterable
is returned.clazz
- Class object corresponding to the type of the entries to be returned, has to implement
AccountancyEntry
Streamable
containing all entries of type clazzOptional<AccountancyEntry> get(AccountancyEntryIdentifier accountancyEntryIdentifier)
AccountancyEntry
of type clazz
and all sub-types, identified by
AccountancyEntryIdentifier
. null is returned, if no entry with the given identifier exists.clazz
- type of the entry to be returned; has to implement AccountancyEntry
accountancyEntryIdentifier
- the AccountancyEntryIdentifier
of the entry to be returnedAccountancyEntry
or sub type thereof of type clazz
which has the identifier
AccountancyEntryIdentifier
Streamable<AccountancyEntry> find(Interval interval)
AccountancyEntry
s that were created in the given Interval
. So every entry with an time
stamp <= to
and >= from
is returned. If no entries within the specified time span exist, or no
entries of the specified class type exist, an empty Streamable
is returned.interval
- the Interval
we want to find AccountancyEntry
instances for.Streamable
containing all entries in the given Interval
.Map<Interval,Streamable<AccountancyEntry>> find(Interval interval, TemporalAmount duration)
AccountancyEntry
s which have their date
within the given Interval
. The
Interval
is divided into parts of length of the given Duration
. According to their respective date,
entries are sorted in exactly one of the time intervals. The last time interval may be shorter than the given
Duration
. Returned is a map, having a Interval
objects as its key, and an Streamable
as
value. The Streamable
contains all entries of the specific type with its date in the interval specified by
the key.T
- common super type of all entries returnedclazz
- class type of the requested entries; has to implement AccountancyEntry
from
- all returned entries will have a time stamp after from
to
- all returned entries will have a time stamp before to
duration
- length of the time intervals, the period between from
and to
is dividedperiod
length between from
and to
as keys, and as value an
Iterable
containing all entries within the key- Interval
Map<Interval,javax.money.MonetaryAmount> salesVolume(Interval interval, TemporalAmount duration)
amount
of all AccountancyEntry
s which have their date
within
(including) from
and to
. from
and to
is divided into parts of period
length. According to their
time stamp, entries are sorted in exactly one of the time intervals. The last time interval may be shorter than
period
.Interval
objects as its key, and a MonetaryAmount
as value. The
MonetaryAmount
object's value is equal to the sum of all entries' amount
-field, with a date within
the key- Interval
. If within an interval no entries of the specified type exist, a MonetaryAmount
object with a value of zero is added as value for that interval.from
- all returned entries will have a time stamp after from
.to
- all returned entries will have a time stamp before to
.duration
- length of the time intervals, the period between from
and to
is divided.Map
, with intervals of period
length between from
and to
as keys, and as
value a MonetaryAmount
object, equal to the sum of the amount fields of all entries within the key-
Interval
.Copyright © 2018 Pivotal Software, Inc.. All rights reserved.