BrightSide Workbench Full Report + Source Code
org.turro.occurrence.AbstractOccurrenceAPI< E > Class Template Referenceabstract
Inheritance diagram for org.turro.occurrence.AbstractOccurrenceAPI< E >:
Collaboration diagram for org.turro.occurrence.AbstractOccurrenceAPI< E >:

Public Member Functions

long getCount ()
 
boolean hasOccurrences (String value)
 
List< E > getList ()
 
void changeOccurrences (String newValue)
 
void removeOccurrences ()
 
- Public Member Functions inherited from org.turro.occurrence.IOccurrenceAPI
String getName ()
 
List< String > getPossibles (String value)
 

Protected Member Functions

Dao getDao ()
 
abstract Dao createDao ()
 
abstract List< E > getOccurrences (String value)
 
abstract String getValue (E value)
 
abstract void setValue (E value, String newValue)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 30 of file AbstractOccurrenceAPI.java.

Member Function Documentation

◆ changeOccurrences()

void org.turro.occurrence.AbstractOccurrenceAPI< E >.changeOccurrences ( String  newValue)

Implements org.turro.occurrence.IOccurrenceAPI.

Definition at line 51 of file AbstractOccurrenceAPI.java.

51  {
52  try(DaoTransaction transaction = new DaoTransaction(getDao())) {
53  for(E e : getList()) {
54  setValue(e, newValue);
55  transaction.saveObject(e);
56  }
57  }
58  }
abstract void setValue(E value, String newValue)
Here is the call graph for this function:

◆ createDao()

abstract Dao org.turro.occurrence.AbstractOccurrenceAPI< E >.createDao ( )
abstractprotected
Here is the caller graph for this function:

◆ getCount()

Implements org.turro.occurrence.IOccurrenceAPI.

Definition at line 35 of file AbstractOccurrenceAPI.java.

35  {
36  return list == null ? 0 : list.size();
37  }
Here is the caller graph for this function:

◆ getDao()

Definition at line 73 of file AbstractOccurrenceAPI.java.

73  {
74  if(_dao == null) {
75  _dao = createDao();
76  }
77  return _dao;
78  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getList()

Definition at line 46 of file AbstractOccurrenceAPI.java.

46  {
47  return list;
48  }
Here is the caller graph for this function:

◆ getOccurrences()

abstract List<E> org.turro.occurrence.AbstractOccurrenceAPI< E >.getOccurrences ( String  value)
abstractprotected
Here is the caller graph for this function:

◆ getValue()

abstract String org.turro.occurrence.AbstractOccurrenceAPI< E >.getValue ( value)
abstractprotected
Here is the caller graph for this function:

◆ hasOccurrences()

boolean org.turro.occurrence.AbstractOccurrenceAPI< E >.hasOccurrences ( String  value)

Implements org.turro.occurrence.IOccurrenceAPI.

Definition at line 40 of file AbstractOccurrenceAPI.java.

40  {
41  list = getOccurrences(value).stream()
42  .filter(t -> getValue(t).equals(value)).collect(Collectors.toList());
43  return getCount() != 0;
44  }
abstract List< E > getOccurrences(String value)
Here is the call graph for this function:

◆ removeOccurrences()

void org.turro.occurrence.AbstractOccurrenceAPI< E >.removeOccurrences ( )

Implements org.turro.occurrence.IOccurrenceAPI.

Definition at line 61 of file AbstractOccurrenceAPI.java.

61  {
62  try(DaoTransaction transaction = new DaoTransaction(getDao())) {
63  for(E e : getList()) {
64  transaction.remove(e);
65  }
66  }
67  }
Here is the call graph for this function:

◆ setValue()

abstract void org.turro.occurrence.AbstractOccurrenceAPI< E >.setValue ( value,
String  newValue 
)
abstractprotected
Here is the caller graph for this function:

The documentation for this class was generated from the following file: