| 1 | package com.drew.metadata.photoshop; |
| 2 | |
| 3 | |
| 4 | /** |
| 5 | * Represents a knot created by Photoshop: |
| 6 | * |
| 7 | * <ul> |
| 8 | * <li>Linked knot</li> |
| 9 | * <li>Unlinked knot</li> |
| 10 | * </ul> |
| 11 | * |
| 12 | * @author Payton Garland |
| 13 | */ |
| 14 | public class Knot |
| 15 | { |
| 16 | private final double[] _points = new double[6]; |
| 17 | private final String _type; |
| 18 | |
| 19 | public Knot(String type) |
| 20 | { |
| 21 | _type = type; |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Add an individual coordinate value (x or y) to |
| 26 | * points array (6 points per knot) |
| 27 | * |
| 28 | * @param index location of point to be added in points |
| 29 | * @param point coordinate value to be added to points |
| 30 | */ |
| 31 | public void setPoint(int index, double point) |
| 32 | { |
| 33 | _points[index] = point; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Get an individual coordinate value (x or y) |
| 38 | * |
| 39 | * @return an individual coordinate value |
| 40 | */ |
| 41 | public double getPoint(int index) |
| 42 | { |
| 43 | return _points[index]; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Get the type of knot (linked or unlinked) |
| 48 | * |
| 49 | * @return the type of knot |
| 50 | */ |
| 51 | public String getType() |
| 52 | { |
| 53 | return this._type; |
| 54 | } |
| 55 | } |