Record Class ExternalLink

java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.content.ExternalLink
Record Components:
index - 1-based index matching the [N] token used in formulas for this link
name - display name — the linked file's base name with the directory stripped, usually keeping the extension (e.g. Book2.xlsx); formulas match it with or without the extension
sheetNames - sheet names of the linked workbook, positional by sheetId
cachedValueCount - number of cached cell values available to the formula evaluator
refreshErrorSheets - indices into sheetNames() whose cache was saved while the source was unreachable — references into those sheets evaluate to #REF!

public record ExternalLink(int index, String name, List<String> sheetNames, int cachedValueCount, List<Integer> refreshErrorSheets) extends Record
An external workbook reference descriptor (immutable, read-only): a linked workbook that formulas such as [Book2]Sheet1!A1 or [1]Sheet1!A1 resolve against. Read back with Workbook.externalLinks().

The engine never opens the linked file — the formula evaluator serves the cell values cached in xl/externalLinks/externalLink{N}.xml at the time the file was last saved by Excel. Unchanged link parts round-trip byte-exact on save. Re-point a link with Workbook.setExternalLinkSource(int, java.lang.String) and remove it with Workbook.removeExternalLink(int). Both take the 0-based position in Workbook.externalLinks(), not the 1-based index().

Reference: ECMA-376 Part 1 §18.14 (external references).

  • Constructor Details

    • ExternalLink

      public ExternalLink(int index, String name, List<String> sheetNames, int cachedValueCount, List<Integer> refreshErrorSheets)
      Creates an instance of a ExternalLink record class.
      Parameters:
      index - the value for the index record component
      name - the value for the name record component
      sheetNames - the value for the sheetNames record component
      cachedValueCount - the value for the cachedValueCount record component
      refreshErrorSheets - the value for the refreshErrorSheets record component
  • Method Details

    • fromMap

      public static ExternalLink fromMap(Map<String,Object> m)
      Build an ExternalLink from one decoded FFI JSON object.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • index

      public int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • sheetNames

      public List<String> sheetNames()
      Returns the value of the sheetNames record component.
      Returns:
      the value of the sheetNames record component
    • cachedValueCount

      public int cachedValueCount()
      Returns the value of the cachedValueCount record component.
      Returns:
      the value of the cachedValueCount record component
    • refreshErrorSheets

      public List<Integer> refreshErrorSheets()
      Returns the value of the refreshErrorSheets record component.
      Returns:
      the value of the refreshErrorSheets record component