Record Class GexfUtil.VisualData

java.lang.Object
java.lang.Record
cloud.opencode.base.graph.serializer.GexfUtil.VisualData
Record Components:
x - x-coordinate | x坐标
y - y-coordinate | y坐标
size - node size | 节点大小
color - color in hex format (#RRGGBB) | 十六进制颜色格式
Enclosing class:
GexfUtil

public static record GexfUtil.VisualData(double x, double y, double size, String color) extends Record
Visual data for graph vertices. 图顶点的可视化数据。
Since:
JDK 25, opencode-base-graph V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Summary

    Constructors
    Constructor
    Description
    VisualData(double x, double y, double size, String color)
    Creates an instance of a VisualData record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the color record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    of(double x, double y, double size, String color)
    Create visual data with all properties.
    position(double x, double y)
    Create visual data with position only.
    double
    Returns the value of the size record component.
    final String
    Returns a string representation of this record class.
    double
    x()
    Returns the value of the x record component.
    double
    y()
    Returns the value of the y record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • VisualData

      public VisualData(double x, double y, double size, String color)
      Creates an instance of a VisualData record class.
      Parameters:
      x - the value for the x record component
      y - the value for the y record component
      size - the value for the size record component
      color - the value for the color record component
  • Method Details

    • position

      public static GexfUtil.VisualData position(double x, double y)
      Create visual data with position only. 仅创建带位置的可视化数据。
      Parameters:
      x - x-coordinate | x坐标
      y - y-coordinate | y坐标
      Returns:
      visual data | 可视化数据
    • of

      public static GexfUtil.VisualData of(double x, double y, double size, String color)
      Create visual data with all properties. 创建带所有属性的可视化数据。
      Parameters:
      x - x-coordinate | x坐标
      y - y-coordinate | y坐标
      size - node size | 节点大小
      color - color | 颜色
      Returns:
      visual data | 可视化数据
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • x

      public double x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • y

      public double y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component
    • size

      public double size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component
    • color

      public String color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component