Project

General

Profile

Download (1.81 KB) Statistics
| Branch: | Revision:

library / src / main / java / org / distorted / library / Float1D.java @ 6a06a912

1
package org.distorted.library;
2

    
3
///////////////////////////////////////////////////////////////////////////////////////////////////
4
/**
5
 * A 1-dimensional data structure containing a single float. The float has no particular meaning; 
6
 * when this data structure is used in Interpolators, we can think of it as a 1-dimensional Point 
7
 * a few of which the Interpolator interpolates between.
8
 */
9

    
10
public class Float1D 
11
  {
12
  float x;
13

    
14
///////////////////////////////////////////////////////////////////////////////////////////////////
15
/**
16
 * Constructor that initialises the value of the single float to ox.   
17
 *   
18
 * @param ox value of the single float.
19
 */
20
  public Float1D(int ox)
21
    {
22
    x = ox;
23
    }
24

    
25
///////////////////////////////////////////////////////////////////////////////////////////////////
26
/**
27
 * Constructor that initialises the value of the single float to ox.   
28
 *   
29
 * @param ox value of the single float.
30
 */  
31
  public Float1D(float ox)
32
    {
33
    x = ox;
34
    }
35
  
36
///////////////////////////////////////////////////////////////////////////////////////////////////
37
/**
38
 * Resets the value of the single float.
39
 * 
40
 * @param ox new value of the single float.
41
 */
42
  public void set(int ox)
43
    {
44
    x = ox;
45
    }
46

    
47
///////////////////////////////////////////////////////////////////////////////////////////////////
48
/**
49
 * Resets the value of the single float.
50
 * 
51
 * @param ox new value of the single float.
52
 */
53
  public void set(float ox)
54
    {
55
    x = ox;
56
    }
57
  
58
///////////////////////////////////////////////////////////////////////////////////////////////////
59
/**
60
 * Return the value of the float contained.
61
 * 
62
 * @return The single float.
63
 */
64
  public float getX()
65
    {
66
    return x;  
67
    }
68
  
69
///////////////////////////////////////////////////////////////////////////////////////////////////
70
// end of class   
71
  }
(16-16/28)