@Test public void testDeserialize() throws Exception { assertEquals(new Vector(1.22, 2, 3), VectorUtils.deserialize("1.22, 2, 3")); assertEquals("1,2,3", VectorUtils.serialize(new Vector(1, 2, 3))); }
@Nonnull public static Vector deserialize(@Nonnull String string) throws NullPointerException { checkNotNullOrEmpty(string); String[] split = DESERIALIZE.split(string, 4); checkArgument(split.length == 3, string + " is in an invalid format."); return new Vector(parseDouble(split[0]), parseDouble(split[1]), parseDouble(split[2])); }
VectorUtils { @Nonnull public static Vector deserialize(@Nonnull String string) throws NullPointerException { checkNotNullOrEmpty(string); String[] split = DESERIALIZE.split(string, 4); checkArgument(split.length == 3, string + " is in an invalid format."); return new Vector(parseDouble(split[0]), parseDouble(split[1]), parseDouble(split[2])); } }
VectorUtils { @Nonnull public static Vector deserialize(@Nonnull String string) throws NullPointerException { checkNotNullOrEmpty(string); String[] split = DESERIALIZE.split(string, 4); checkArgument(split.length == 3, string + " is in an invalid format."); return new Vector(parseDouble(split[0]), parseDouble(split[1]), parseDouble(split[2])); }  }
VectorUtils { @Nonnull public static Vector deserialize(@Nonnull String string) throws NullPointerException { checkNotNullOrEmpty(string); String[] split = DESERIALIZE.split(string, 4); checkArgument(split.length == 3, string + " is in an invalid format."); return new Vector(parseDouble(split[0]), parseDouble(split[1]), parseDouble(split[2])); }  @Nonnull static Vector deserialize(@Nonnull String string); static String serialize(Vector vector); static Vector getRandomVectorWithin(Vector min, Vector max); static boolean isWithin(Vector test, Vector min, Vector max); static boolean isSameBlock(@Nullable Vector o, @Nullable Vector o2); static Vector getIntermediateWithXValue(Vector origin, Vector vec, double x); static Vector getIntermediateWithYValue(Vector origin, Vector vec, double y); static Vector getIntermediateWithZValue(Vector origin, Vector vec, double z); @Nonnull static RelativeVector deserializeRelative(@Nonnull String string); static String serializeRelative(RelativeVector vector); }
VectorUtils { @Nonnull public static Vector deserialize(@Nonnull String string) throws NullPointerException { checkNotNullOrEmpty(string); String[] split = DESERIALIZE.split(string, 4); checkArgument(split.length == 3, string + " is in an invalid format."); return new Vector(parseDouble(split[0]), parseDouble(split[1]), parseDouble(split[2])); }  @Nonnull static Vector deserialize(@Nonnull String string); static String serialize(Vector vector); static Vector getRandomVectorWithin(Vector min, Vector max); static boolean isWithin(Vector test, Vector min, Vector max); static boolean isSameBlock(@Nullable Vector o, @Nullable Vector o2); static Vector getIntermediateWithXValue(Vector origin, Vector vec, double x); static Vector getIntermediateWithYValue(Vector origin, Vector vec, double y); static Vector getIntermediateWithZValue(Vector origin, Vector vec, double z); @Nonnull static RelativeVector deserializeRelative(@Nonnull String string); static String serializeRelative(RelativeVector vector);  }