Class CitationByYear

java.lang.Object
eu.dnetlib.dhp.schema.oaf.CitationByYear
All Implemented Interfaces:
Serializable

public class CitationByYear extends Object implements 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 Details

    • CitationByYear

      public CitationByYear()
    • CitationByYear

      public CitationByYear(Map<Integer,Long> citationCounts)
  • Method Details

    • getCountForYear

      public Long getCountForYear(Integer year)
      Gets the citation count for a specific year.
      Parameters:
      year - the 4-digit year
      Returns:
      the count, or 0 if not present
    • addCount

      public void addCount(Integer year, Long count)
      Adds or updates citation count for a specific year. Invalid entries (bad year or negative count) are silently rejected.
      Parameters:
      year - the 4-digit year
      count - the non-negative count
    • incrementCount

      public void incrementCount(Integer year, Long delta)
      Increments the citation count for a year (aggregate behavior). Invalid entries are silently rejected.
      Parameters:
      year - the 4-digit year
      delta - the amount to add
    • getTotalCitations

      public Long 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

      public static boolean isValidYearEntry(Integer year, Long count)
      Validates year format (4-digit integer) and count (non-negative). Invalid entries are not added.
      Parameters:
      year - the year to validate
      count - the count to validate
      Returns:
      true if both year and count are valid
    • getCitationCounts

      public Map<Integer,Long> getCitationCounts()
    • setCitationCounts

      public void setCitationCounts(Map<Integer,Long> citationCounts)