1
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2
|
// Copyright 2016 Leszek Koltunski //
|
3
|
// //
|
4
|
// This file is part of Distorted. //
|
5
|
// //
|
6
|
// Distorted is free software: you can redistribute it and/or modify //
|
7
|
// it under the terms of the GNU General Public License as published by //
|
8
|
// the Free Software Foundation, either version 2 of the License, or //
|
9
|
// (at your option) any later version. //
|
10
|
// //
|
11
|
// Distorted is distributed in the hope that it will be useful, //
|
12
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
13
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
14
|
// GNU General Public License for more details. //
|
15
|
// //
|
16
|
// You should have received a copy of the GNU General Public License //
|
17
|
// along with Distorted. If not, see <http://www.gnu.org/licenses/>. //
|
18
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
19
|
|
20
|
package org.distorted.library.type;
|
21
|
|
22
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
23
|
/**
|
24
|
* A 1-dimensional data structure containing a single float. The float has no particular meaning;
|
25
|
* when this data structure is used in Dynamics, we can think of it as a 1-dimensional Point
|
26
|
* a few of which the Dynamic interpolates between.
|
27
|
*/
|
28
|
|
29
|
public class Static1D implements Data1D
|
30
|
{
|
31
|
float x;
|
32
|
|
33
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
34
|
/**
|
35
|
* Constructor that initialises the value of the single float to ox.
|
36
|
*
|
37
|
* @param ox value of the single float.
|
38
|
*/
|
39
|
public Static1D(int ox)
|
40
|
{
|
41
|
x = ox;
|
42
|
}
|
43
|
|
44
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
45
|
/**
|
46
|
* Constructor that initialises the value of the single float to ox.
|
47
|
*
|
48
|
* @param ox value of the single float.
|
49
|
*/
|
50
|
public Static1D(float ox)
|
51
|
{
|
52
|
x = ox;
|
53
|
}
|
54
|
|
55
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
56
|
/**
|
57
|
* Resets the value of the single float.
|
58
|
*
|
59
|
* @param ox new value of the single float.
|
60
|
*/
|
61
|
public void set(int ox)
|
62
|
{
|
63
|
x = ox;
|
64
|
}
|
65
|
|
66
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
67
|
/**
|
68
|
* Resets the value of the single float.
|
69
|
*
|
70
|
* @param ox new value of the single float.
|
71
|
*/
|
72
|
public void set(float ox)
|
73
|
{
|
74
|
x = ox;
|
75
|
}
|
76
|
|
77
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
78
|
/**
|
79
|
* Resets the value of the first float.
|
80
|
*
|
81
|
* @param ox new value of the first float.
|
82
|
*/
|
83
|
public void set1(int ox)
|
84
|
{
|
85
|
x = ox;
|
86
|
}
|
87
|
|
88
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
89
|
/**
|
90
|
* Resets the value of the first float.
|
91
|
*
|
92
|
* @param ox new value of the first float.
|
93
|
*/
|
94
|
public void set1(float ox)
|
95
|
{
|
96
|
x = ox;
|
97
|
}
|
98
|
|
99
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
100
|
/**
|
101
|
* Return the value of the float contained.
|
102
|
*
|
103
|
* @return The single float.
|
104
|
*/
|
105
|
public float getX()
|
106
|
{
|
107
|
return x;
|
108
|
}
|
109
|
|
110
|
}
|