com.groupdocs.viewer.results

Class TextElement<T>

  • Direct Known Subclasses:
    Character, Line, Word


    public class TextElement<T>
    extends Object

    Represents generic text element.

    T: The text element type.

    • Constructor Summary

      Constructors 
      Constructor and Description
      TextElement(T value, double x, double y, double width, double height)
      Initializes new instance of TextElement<T> class.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      double getHeight()
      The height of the rectangle which contains the element (in pixels).
      T getValue()
      The element value.
      double getWidth()
      The width of the rectangle which contains the element (in pixels).
      double getX()
      The X coordinate of the highest left point on the page layout where the rectangle that contains element begins.
      double getY()
      The Y coordinate of the highest left point on the page layout where the rectangle that contains element begins.
      String toString()
      Returns a string that represents the current object.
    • Constructor Detail

      • TextElement

        public TextElement(T value,
                   double x,
                   double y,
                   double width,
                   double height)

        Initializes new instance of TextElement<T> class.

        Parameters:
        value - The text element value.
        x - The X coordinate of the highest left point on the page layout where the rectangle that contains element begins.
        y - The Y coordinate of the highest left point on the page layout where the rectangle that contains element begins.
        width - The width of the rectangle which contains the element (in pixels).
        height - The height of the rectangle which contains the element (in pixels).
        Throws:
        IllegalArgumentException - Thrown when value is null.
        IllegalArgumentException - Thrown when width is less or equal to zero.
        IllegalArgumentException - Thrown when height is less or equal to zero.
    • Method Detail

      • getHeight

        public final double getHeight()
        The height of the rectangle which contains the element (in pixels).
        Returns:
        The height of the rectangle which contains the element (in pixels).
      • getValue

        public final T getValue()
        The element value.
        Returns:
        The element value.
      • getWidth

        public final double getWidth()
        The width of the rectangle which contains the element (in pixels).
        Returns:
        The width of the rectangle which contains the element (in pixels).
      • getX

        public final double getX()
        The X coordinate of the highest left point on the page layout where the rectangle that contains element begins.
        Returns:
        The X coordinate of the highest left point on the page layout where the rectangle that contains element begins.
      • getY

        public final double getY()
        The Y coordinate of the highest left point on the page layout where the rectangle that contains element begins.
        Returns:
        The Y coordinate of the highest left point on the page layout where the rectangle that contains element begins.
      • toString

        public String toString()

        Returns a string that represents the current object.

        Overrides:
        toString in class Object
        Returns:
        A string that represents the current object.