Package adaptlil.data_classes
Class Fixation
java.lang.Object
adaptlil.data_classes.Fixation
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the duration of the fixationstatic Fixation
getFixationFromCSVLine
(int durationColIndex, int xColIndex, int yColIndex, int idColIndex, int timestampColIndex, String[] fixationLine) Constructs a fixation object through specification of the array indices of the fixationLine argumentint
getId()
Returns the id of the fixation (default -1)getPoint()
Get the fixation in terms of a 2D-Cartesian pointdouble
Returns the startTime of the fixationdouble
getX()
Get x-coordinate of the fixation in terms of point on the screen.double
getY()
Get y-coordinate of the fixation in terms of point on the screen.Fixation[]
interpolate
(Fixation firstFixation, Fixation nextFixation, int nSteps) Performs Linear interpolation nSteps Fixation elements between the first Fixation and the next Fixationboolean
isValid()
Flag set by gazepoint to signify that this Fixation packet may be corrupt.void
setDuration
(double duration) Setter for the duration of the fixationvoid
setId
(int id) Setter for the id of the fixationvoid
setStartTime
(double startTime) Setter for the StartTime of the fixationvoid
Setter for the isValid flag (signifies if the packet is corrupt)void
setX
(double x) Set X coordinate (fraction of screen-width)void
setY
(double y) Set y coordinate (fraction of screen-height)
-
Field Details
-
x
private double x -
y
private double y -
startTime
private double startTime -
duration
private double duration -
id
private int id -
isValid
private boolean isValid
-
-
Constructor Details
-
Fixation
public Fixation() -
Fixation
public Fixation(double x, double y, double startTime, double duration, boolean isValid, int id) -
Fixation
public Fixation(double x, double y, double startTime, double duration, boolean isValid) -
Fixation
public Fixation(double x, double y, double duration) - Parameters:
x
- The x coordinate of the fixation (fraction of screen width)y
- The y coordinate of the fixation (fraction of screen height)duration
- Duration of the fixation
-
-
Method Details
-
getFixationFromCSVLine
public static Fixation getFixationFromCSVLine(int durationColIndex, int xColIndex, int yColIndex, int idColIndex, int timestampColIndex, String[] fixationLine) Constructs a fixation object through specification of the array indices of the fixationLine argument- Parameters:
durationColIndex
-xColIndex
-yColIndex
-idColIndex
-timestampColIndex
-fixationLine
- Array of strings representing a single row in a CSV file- Returns:
-
interpolate
Performs Linear interpolation nSteps Fixation elements between the first Fixation and the next Fixation- Parameters:
firstFixation
-nextFixation
-nSteps
-- Returns:
-
getPoint
Get the fixation in terms of a 2D-Cartesian point- Returns:
-
getX
public double getX()Get x-coordinate of the fixation in terms of point on the screen.- Returns:
- Returns x coordinate in range [0-1] where 0.5 is the middle of the screen on the x-axis
-
getY
public double getY()Get y-coordinate of the fixation in terms of point on the screen.- Returns:
- Returns y coordinate in range [0-1] where 0.5 is the middle of the screen on the y-axis
-
getStartTime
public double getStartTime()Returns the startTime of the fixation- Returns:
-
getDuration
public double getDuration()Returns the duration of the fixation- Returns:
-
getId
public int getId()Returns the id of the fixation (default -1)- Returns:
-
isValid
public boolean isValid()Flag set by gazepoint to signify that this Fixation packet may be corrupt.- Returns:
-
setX
public void setX(double x) Set X coordinate (fraction of screen-width)- Parameters:
x
-
-
setY
public void setY(double y) Set y coordinate (fraction of screen-height)- Parameters:
y
-
-
setStartTime
public void setStartTime(double startTime) Setter for the StartTime of the fixation- Parameters:
startTime
-
-
setDuration
public void setDuration(double duration) Setter for the duration of the fixation- Parameters:
duration
-
-
setId
public void setId(int id) Setter for the id of the fixation- Parameters:
id
-
-
setValid
Setter for the isValid flag (signifies if the packet is corrupt)- Parameters:
valid
-
-