Interface PdfElement

All Known Implementing Classes:
PdfEllipse, PdfImage, PdfLine, PdfParagraph, PdfRectangle, PdfTable, PdfText

public sealed interface PdfElement permits PdfText, PdfParagraph, PdfImage, PdfTable, PdfLine, PdfRectangle, PdfEllipse
PDF Content Element - Base interface for all PDF content elements PDF 内容元素 - 所有 PDF 内容元素的基础接口

Sealed interface permitting only known content element types.

密封接口,仅允许已知的内容元素类型。

Features | 主要功能:

  • Common coordinate access for all content elements - 所有内容元素的公共坐标访问
  • Sealed type hierarchy for type-safe pattern matching - 密封类型层次结构用于类型安全的模式匹配

Usage Examples | 使用示例:

PdfElement element = PdfText.of("Hello", 100, 700);
float x = element.getX();
float y = element.getY();

Security | 安全性:

  • Thread-safe: Depends on implementation - 线程安全: 取决于实现
  • Null-safe: N/A — interface defines no mutators - 空值安全: 不适用 — 接口不定义修改器
Since:
JDK 25, opencode-base-pdf V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Gets the x coordinate of this element 获取元素的 x 坐标
    float
    Gets the y coordinate of this element 获取元素的 y 坐标
  • Method Details

    • getX

      float getX()
      Gets the x coordinate of this element 获取元素的 x 坐标
      Returns:
      x coordinate | x 坐标
    • getY

      float getY()
      Gets the y coordinate of this element 获取元素的 y 坐标
      Returns:
      y coordinate | y 坐标