Class Sphere2D

  • All Implemented Interfaces:
    java.io.Serializable, Space

    public class Sphere2D
    extends java.lang.Object
    implements java.io.Serializable, Space
    This class implements a two-dimensional sphere (i.e. the regular sphere).

    We use here the topologists definition of the 2-sphere (see Sphere on MathWorld), i.e. the 2-sphere is the two-dimensional surface defined in 3D as x2+y2+z2=1.

    Since:
    3.3
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  Sphere2D.LazyHolder
      Holder for the instance.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long serialVersionUID
      Serializable version identifier.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Sphere2D()
      Private constructor for the singleton.
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Serializable version identifier.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Sphere2D

        private Sphere2D()
        Private constructor for the singleton.
    • Method Detail

      • getInstance

        public static Sphere2D getInstance()
        Get the unique instance.
        Returns:
        the unique instance
      • getDimension

        public int getDimension()
        Get the dimension of the space.
        Specified by:
        getDimension in interface Space
        Returns:
        dimension of the space
      • readResolve

        private java.lang.Object readResolve()
        Handle deserialization of the singleton.
        Returns:
        the singleton instance