Class Tuple1d<RT extends Tuple1d<? super RT>>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected WeakReference<Segment1D<?,​?>> segment
      x coordinate.
      protected double x
      x coordinate.
      protected double y
      y coordinate.
    • Constructor Summary

      Constructors 
      Constructor Description
      Tuple1d()
      Construct a zero tuple.
      Tuple1d​(Segment1D<?,​?> segment)
      Construct a zero tuple.
      Tuple1d​(Segment1D<?,​?> segment, double[] tuple)
      Constructor.
      Tuple1d​(Segment1D<?,​?> segment, double x, double y)
      Construct a tuple with the given coordinates.
      Tuple1d​(Segment1D<?,​?> segment, int[] tuple)
      Constructor.
      Tuple1d​(Segment1D<?,​?> segment, int x, int y)
      Construct a tuple with the given coordinates.
      Tuple1d​(Segment1D<?,​?> segment, Tuple2D<?> tuple)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void absolute()
      Sets each component of this tuple to its absolute value.
      void absolute​(Tuple2D<?> tuple)
      Sets each component of the tuple parameter to its absolute value and places the modified values into this tuple.
      void add​(double x, double y)
      Sets the value of this tuple to the sum of itself and x and y.
      void add​(int x, int y)
      Sets the value of this tuple to the sum of itself and x and y.
      void addX​(double x)
      Sets the x value of this tuple to the sum of itself and x.
      void addX​(int x)
      Sets the x value of this tuple to the sum of itself and x.
      void addY​(double y)
      Sets the y value of this tuple to the sum of itself and y.
      void addY​(int y)
      Sets the y value of this tuple to the sum of itself and y.
      RT clone()
      Clone this point.
      boolean equals​(Object object)
      Returns true if the Object t1 is of type Tuple2D and all of the data members of t1 are equal to the corresponding data members in this Tuple2D.
      GeomFactory1D<Vector1d,​Point1d> getGeomFactory()
      Replies the geometry factory.
      Segment1D<?,​?> getSegment()
      Replies the segment.
      double getX()
      Get the x coordinate.
      double getY()
      Get the y coordinate.
      int hashCode()
      Returns a hash code value based on the data values in this object.
      int ix()
      Get the x coordinate.
      int iy()
      Get the y coordinate.
      void negate()
      Negates the value of this tuple in place.
      void negate​(Tuple2D<?> tuple)
      Sets the value of this tuple to the negation of tuple t1.
      void scale​(double scale)
      Sets the value of this tuple to the scalar multiplication of the scale factor with this.
      void scale​(double scale, Tuple2D<?> tuple)
      Sets the value of this tuple to the scalar multiplication of tuple t1.
      void scale​(int scale)
      Sets the value of this tuple to the scalar multiplication of the scale factor with this.
      void scale​(int scale, Tuple2D<?> tuple)
      Sets the value of this tuple to the scalar multiplication of tuple t1.
      void set​(double[] tuple)
      Sets the value of this tuple from the 2 values specified in the array.
      void set​(double x, double y)
      Sets the value of this tuple to the specified x and y coordinates.
      void set​(int[] tuple)
      Sets the value of this tuple from the 2 values specified in the array.
      void set​(int x, int y)
      Sets the value of this tuple to the specified x and y coordinates.
      void set​(Segment1D<?,​?> segment, double curviline, double shift)
      Change the attributes of the tuple.
      void set​(Tuple2D<?> tuple)
      Sets the value of this tuple to the value of tuple t1.
      void setSegment​(Segment1D<?,​?> segment)
      Set the segment.
      void setX​(double x)
      Set the x coordinate.
      void setX​(int x)
      Set the x coordinate.
      void setY​(double y)
      Set the y coordinate.
      void setY​(int y)
      Set the y coordinate.
      void sub​(double x, double y)
      Sets the value of this tuple to the difference of itself and x and y.
      void sub​(int x, int y)
      Sets the value of this tuple to the difference of itself and x and y.
      void subX​(double x)
      Sets the x value of this tuple to the difference of itself and x.
      void subX​(int x)
      Sets the x value of this tuple to the difference of itself and x.
      void subY​(double y)
      Sets the y value of this tuple to the difference of itself and y.
      void subY​(int y)
      Sets the y value of this tuple to the difference of itself and y.
      void toJson​(JsonBuffer buffer)
      Replies the Json representation of this node.
      String toString()  
    • Field Detail

      • x

        protected double x
        x coordinate.
      • y

        protected double y
        y coordinate.
    • Constructor Detail

      • Tuple1d

        public Tuple1d()
        Construct a zero tuple.
      • Tuple1d

        public Tuple1d​(Segment1D<?,​?> segment)
        Construct a zero tuple.
        Parameters:
        segment - the segment.
      • Tuple1d

        public Tuple1d​(Segment1D<?,​?> segment,
                       Tuple2D<?> tuple)
        Constructor.
        Parameters:
        segment - the segment.
        tuple - is the tuple to copy.
      • Tuple1d

        public Tuple1d​(Segment1D<?,​?> segment,
                       int[] tuple)
        Constructor.
        Parameters:
        segment - the segment.
        tuple - is the tuple to copy.
      • Tuple1d

        public Tuple1d​(Segment1D<?,​?> segment,
                       double[] tuple)
        Constructor.
        Parameters:
        segment - the segment.
        tuple - is the tuple to copy.
      • Tuple1d

        public Tuple1d​(Segment1D<?,​?> segment,
                       int x,
                       int y)
        Construct a tuple with the given coordinates.
        Parameters:
        segment - the segment.
        x - x coordinate.
        y - y coordinate.
      • Tuple1d

        public Tuple1d​(Segment1D<?,​?> segment,
                       double x,
                       double y)
        Construct a tuple with the given coordinates.
        Parameters:
        segment - the segment.
        x - x coordinate.
        y - y coordinate.
    • Method Detail

      • getSegment

        @Pure
        public Segment1D<?,​?> getSegment()
        Replies the segment.
        Returns:
        the segment or null if the weak reference has lost the segment.
      • setSegment

        public void setSegment​(Segment1D<?,​?> segment)
        Set the segment.
        Parameters:
        segment - is the segment.
      • clone

        @Pure
        public RT clone()
        Description copied from interface: Tuple2D
        Clone this point.
        Specified by:
        clone in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Overrides:
        clone in class Object
        Returns:
        the clone.
      • absolute

        public void absolute()
        Description copied from interface: Tuple2D
        Sets each component of this tuple to its absolute value.
        Specified by:
        absolute in interface Tuple2D<RT extends Tuple1d<? super RT>>
      • absolute

        public void absolute​(Tuple2D<?> tuple)
        Description copied from interface: Tuple2D
        Sets each component of the tuple parameter to its absolute value and places the modified values into this tuple.
        Specified by:
        absolute in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        tuple - the source tuple, which will not be modified
      • add

        public void add​(int x,
                        int y)
        Description copied from interface: Tuple2D
        Sets the value of this tuple to the sum of itself and x and y.
        Specified by:
        add in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        x - x coordinate to add.
        y - y coordinate to add.
      • add

        public void add​(double x,
                        double y)
        Description copied from interface: Tuple2D
        Sets the value of this tuple to the sum of itself and x and y.
        Specified by:
        add in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        x - x coordinate to add.
        y - y coordinate to add.
      • addX

        public void addX​(int x)
        Description copied from interface: Tuple2D
        Sets the x value of this tuple to the sum of itself and x.
        Specified by:
        addX in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        x - x coordinate to add.
      • addX

        public void addX​(double x)
        Description copied from interface: Tuple2D
        Sets the x value of this tuple to the sum of itself and x.
        Specified by:
        addX in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        x - x coordinate to add.
      • addY

        public void addY​(int y)
        Description copied from interface: Tuple2D
        Sets the y value of this tuple to the sum of itself and y.
        Specified by:
        addY in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        y - y coordinate to add.
      • addY

        public void addY​(double y)
        Description copied from interface: Tuple2D
        Sets the y value of this tuple to the sum of itself and y.
        Specified by:
        addY in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        y - y coordinate to add.
      • negate

        public void negate​(Tuple2D<?> tuple)
        Description copied from interface: Tuple2D
        Sets the value of this tuple to the negation of tuple t1.
        Specified by:
        negate in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        tuple - the source tuple
      • negate

        public void negate()
        Description copied from interface: Tuple2D
        Negates the value of this tuple in place.
        Specified by:
        negate in interface Tuple2D<RT extends Tuple1d<? super RT>>
      • scale

        public void scale​(int scale,
                          Tuple2D<?> tuple)
        Description copied from interface: Tuple2D
        Sets the value of this tuple to the scalar multiplication of tuple t1.
        Specified by:
        scale in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        scale - the scalar value
        tuple - the source tuple
      • scale

        public void scale​(double scale,
                          Tuple2D<?> tuple)
        Description copied from interface: Tuple2D
        Sets the value of this tuple to the scalar multiplication of tuple t1.
        Specified by:
        scale in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        scale - the scalar value
        tuple - the source tuple
      • scale

        public void scale​(int scale)
        Description copied from interface: Tuple2D
        Sets the value of this tuple to the scalar multiplication of the scale factor with this.
        Specified by:
        scale in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        scale - the scalar value
      • scale

        public void scale​(double scale)
        Description copied from interface: Tuple2D
        Sets the value of this tuple to the scalar multiplication of the scale factor with this.
        Specified by:
        scale in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        scale - the scalar value
      • set

        public void set​(Segment1D<?,​?> segment,
                        double curviline,
                        double shift)
        Change the attributes of the tuple.
        Parameters:
        segment - the segment.
        curviline - the curviline coordinate.
        shift - the shift distance.
      • set

        public void set​(Tuple2D<?> tuple)
        Description copied from interface: Tuple2D
        Sets the value of this tuple to the value of tuple t1.
        Specified by:
        set in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        tuple - the tuple to be copied
      • set

        public void set​(int x,
                        int y)
        Description copied from interface: Tuple2D
        Sets the value of this tuple to the specified x and y coordinates.
        Specified by:
        set in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        x - the x coordinate
        y - the y coordinate
      • set

        public void set​(double x,
                        double y)
        Description copied from interface: Tuple2D
        Sets the value of this tuple to the specified x and y coordinates.
        Specified by:
        set in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        x - the x coordinate
        y - the y coordinate
      • set

        public void set​(int[] tuple)
        Description copied from interface: Tuple2D
        Sets the value of this tuple from the 2 values specified in the array.
        Specified by:
        set in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        tuple - the array of length 2 containing xy in order
      • set

        public void set​(double[] tuple)
        Description copied from interface: Tuple2D
        Sets the value of this tuple from the 2 values specified in the array.
        Specified by:
        set in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        tuple - the array of length 2 containing xy in order
      • getX

        @Pure
        public double getX()
        Description copied from interface: Tuple2D
        Get the x coordinate.
        Specified by:
        getX in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Returns:
        the x coordinate.
      • ix

        @Pure
        public int ix()
        Description copied from interface: Tuple2D
        Get the x coordinate.
        Specified by:
        ix in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Returns:
        the x coordinate.
      • setX

        public void setX​(int x)
        Description copied from interface: Tuple2D
        Set the x coordinate.
        Specified by:
        setX in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        x - value to x coordinate.
      • setX

        public void setX​(double x)
        Description copied from interface: Tuple2D
        Set the x coordinate.
        Specified by:
        setX in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        x - value to x coordinate.
      • getY

        @Pure
        public double getY()
        Description copied from interface: Tuple2D
        Get the y coordinate.
        Specified by:
        getY in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Returns:
        the y coordinate.
      • iy

        @Pure
        public int iy()
        Description copied from interface: Tuple2D
        Get the y coordinate.
        Specified by:
        iy in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Returns:
        the y coordinate.
      • setY

        public void setY​(int y)
        Description copied from interface: Tuple2D
        Set the y coordinate.
        Specified by:
        setY in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        y - value to y coordinate.
      • setY

        public void setY​(double y)
        Description copied from interface: Tuple2D
        Set the y coordinate.
        Specified by:
        setY in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        y - value to y coordinate.
      • sub

        public void sub​(int x,
                        int y)
        Description copied from interface: Tuple2D
        Sets the value of this tuple to the difference of itself and x and y.
        Specified by:
        sub in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        x - x coordinate to substract.
        y - y coordinate to substract.
      • sub

        public void sub​(double x,
                        double y)
        Description copied from interface: Tuple2D
        Sets the value of this tuple to the difference of itself and x and y.
        Specified by:
        sub in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        x - x coordinate to substract.
        y - y coordinate to substract.
      • subX

        public void subX​(int x)
        Description copied from interface: Tuple2D
        Sets the x value of this tuple to the difference of itself and x.
        Specified by:
        subX in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        x - x coordinate to substract.
      • subX

        public void subX​(double x)
        Description copied from interface: Tuple2D
        Sets the x value of this tuple to the difference of itself and x.
        Specified by:
        subX in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        x - x coordinate to substract.
      • subY

        public void subY​(int y)
        Description copied from interface: Tuple2D
        Sets the y value of this tuple to the difference of itself and y.
        Specified by:
        subY in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        y - y coordinate to substract.
      • subY

        public void subY​(double y)
        Description copied from interface: Tuple2D
        Sets the y value of this tuple to the difference of itself and y.
        Specified by:
        subY in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Parameters:
        y - y coordinate to substract.
      • equals

        @Pure
        public boolean equals​(Object object)
        Description copied from interface: Tuple2D
        Returns true if the Object t1 is of type Tuple2D and all of the data members of t1 are equal to the corresponding data members in this Tuple2D.
        Specified by:
        equals in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Overrides:
        equals in class Object
        Parameters:
        object - the object with which the comparison is made
        Returns:
        true or false
      • hashCode

        @Pure
        public int hashCode()
        Description copied from interface: Tuple2D
        Returns a hash code value based on the data values in this object. Two different Tuple2D objects with identical data values (i.e., Tuple2D.equals(Object) returns true) will return the same hash code value. Two objects with different data members may return the same hash value, although this is not likely.
        Specified by:
        hashCode in interface Tuple2D<RT extends Tuple1d<? super RT>>
        Overrides:
        hashCode in class Object
        Returns:
        the integer hash code value
      • toJson

        public void toJson​(JsonBuffer buffer)
        Description copied from interface: JsonableObject
        Replies the Json representation of this node.
        Specified by:
        toJson in interface JsonableObject
        Parameters:
        buffer - the Json buffer.