/*
 *  Copyright (c) 2023-2026, Easy-Agents (fuhai999@gmail.com).
 *  <p>
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  <p>
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  <p>
 *  Licensed under the Apache License, Version 2.0.
 */
package com.easyagents.core.file2text;

import java.util.ArrayList;
import java.util.List;

/**
 * 带稳定定位信息的文档文本片段。
 */
public class DocumentTextSegment {

    private String segmentId;
    private String text;
    private String locatorType;
    private String locatorLabel;
    private int startIndex;
    private int endIndex;
    private List<String> headingPath = new ArrayList<>();
    private int tokenEstimate;

    /** @return 片段 ID */
    public String getSegmentId() { return segmentId; }

    /** @param segmentId 片段 ID */
    public void setSegmentId(String segmentId) { this.segmentId = segmentId; }

    /** @return 片段文本 */
    public String getText() { return text; }

    /** @param text 片段文本 */
    public void setText(String text) { this.text = text; }

    /** @return 定位类型 */
    public String getLocatorType() { return locatorType; }

    /** @param locatorType 定位类型 */
    public void setLocatorType(String locatorType) { this.locatorType = locatorType; }

    /** @return 可读定位标签 */
    public String getLocatorLabel() { return locatorLabel; }

    /** @param locatorLabel 可读定位标签 */
    public void setLocatorLabel(String locatorLabel) { this.locatorLabel = locatorLabel; }

    /** @return 全文起始字符下标 */
    public int getStartIndex() { return startIndex; }

    /** @param startIndex 全文起始字符下标 */
    public void setStartIndex(int startIndex) { this.startIndex = startIndex; }

    /** @return 全文结束字符下标 */
    public int getEndIndex() { return endIndex; }

    /** @param endIndex 全文结束字符下标 */
    public void setEndIndex(int endIndex) { this.endIndex = endIndex; }

    /** @return 标题路径 */
    public List<String> getHeadingPath() { return headingPath; }

    /** @param headingPath 标题路径 */
    public void setHeadingPath(List<String> headingPath) {
        this.headingPath = headingPath == null ? new ArrayList<>() : new ArrayList<>(headingPath);
    }

    /** @return Token 估算 */
    public int getTokenEstimate() { return tokenEstimate; }

    /** @param tokenEstimate Token 估算 */
    public void setTokenEstimate(int tokenEstimate) { this.tokenEstimate = tokenEstimate; }
}
