Package eu.dnetlib.dhp.schema.oaf
Class CitationByYear
java.lang.Object
eu.dnetlib.dhp.schema.oaf.CitationByYear
- All Implemented Interfaces:
Serializable
Represents citation counts organized by the year the citations were received.
Enables "citations over time" analytics without relying on publication year proxies.
Data semantics:
- Year refers to the year citations were received (not publication year).
- Multiple years per record are supported.
- Empty/missing citation time series is valid (field can be null/absent).
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds or updates citation count for a specific year.getCountForYear(Integer year) Gets the citation count for a specific year.Gets total citation count across all years (computed, not stored).voidincrementCount(Integer year, Long delta) Increments the citation count for a year (aggregate behavior).static booleanisValidYearEntry(Integer year, Long count) Validates year format (4-digit integer) and count (non-negative).voidsetCitationCounts(Map<Integer, Long> citationCounts)
-
Constructor Details
-
CitationByYear
public CitationByYear() -
CitationByYear
-
-
Method Details
-
getCountForYear
Gets the citation count for a specific year.- Parameters:
year- the 4-digit year- Returns:
- the count, or 0 if not present
-
addCount
Adds or updates citation count for a specific year. Invalid entries (bad year or negative count) are silently rejected.- Parameters:
year- the 4-digit yearcount- the non-negative count
-
incrementCount
Increments the citation count for a year (aggregate behavior). Invalid entries are silently rejected.- Parameters:
year- the 4-digit yeardelta- the amount to add
-
getTotalCitations
Gets total citation count across all years (computed, not stored). Marked as @JsonIgnore to prevent serialization as a separate field.- Returns:
- the sum of all citation counts
-
isValidYearEntry
Validates year format (4-digit integer) and count (non-negative). Invalid entries are not added.- Parameters:
year- the year to validatecount- the count to validate- Returns:
- true if both year and count are valid
-
getCitationCounts
-
setCitationCounts
-