StringSerializer
This utility class provides methods for converting various Pathfinder data types (like PointXY, PointXYZ, Angle, and Translation) into String representations (serialization) and back from String representations (deserialization).
Methods
deserialize(String string, int expectedValues)
Private static helper method. Deserializes a comma-separated String into a double array. It expects a specific number of values and throws an IllegalArgumentException if the count does not match.
fastFormat(double... values)
Private static helper method. Formats a variable number of double values into a comma-separated String. Throws an IllegalArgumentException if no values are provided.
serializePointXY(PointXY point)
Serializes a PointXY object into a String (e.g., "x,y").
deserializePointXY(String string)
Deserializes a String back into a PointXY object.
serializePointXYZ(PointXYZ point)
Serializes a PointXYZ object into a String (e.g., "x,y,z"). The Z component is serialized as degrees.
deserializePointXYZ(String string)
Deserializes a String back into a PointXYZ object.
serializeAngle(Angle angle)
Serializes an Angle object into a String (e.g., "degrees").
deserializeAngle(String string)
Deserializes a String back into an Angle object.
serializeTranslation(Translation t)
Serializes a Translation object into a String (e.g., "vx,vy,vz").
deserializeTranslation(String string)
Deserializes a String back into a Translation object.