net.aerith.misao.util.star
Class StarPosition
java.lang.Object
|
+--net.aerith.misao.util.Position
|
+--net.aerith.misao.util.star.StarPosition
- Direct Known Subclasses:
- Star
- public class StarPosition
- extends Position
The StarPosition
represents a star which consists of
(x,y) position and magnitude. The position is expressed in float
data.
Field Summary |
protected float |
mag
The magnitude value. |
Fields inherited from class net.aerith.misao.util.Position |
x,
y |
Constructor Summary |
StarPosition()
Constructs an empty StarPosition . |
StarPosition(double initial_x,
double initial_y,
double initial_mag)
Constructs a StarPosition with specified position
and magnitude. |
Method Summary |
double |
getMag()
Gets the magnitude value. |
java.lang.String |
getOutputString()
Returns a string representation of the state of this object. |
java.lang.String[] |
getOutputStrings()
Returns an array of string representations of the state of
stars contained in this object. |
protected java.lang.String |
paramString()
Returns a raw string representation of the state of this object,
for debugging use. |
void |
setMag(double new_mag)
Sets the magnitude value. |
java.lang.String |
toString()
Returns a string representation of the state of this object,
for debugging use. |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
mag
protected float mag
- The magnitude value.
StarPosition
public StarPosition()
- Constructs an empty
StarPosition
. The position is
set at (0,0).
StarPosition
public StarPosition(double initial_x,
double initial_y,
double initial_mag)
- Constructs a
StarPosition
with specified position
and magnitude.
- Parameters:
initial_x
- the x position.initial_y
- the y position.initial_mag
- the magnitude.
getMag
public double getMag()
- Gets the magnitude value.
- Returns:
- the magnitude value.
setMag
public void setMag(double new_mag)
- Sets the magnitude value.
- Parameters:
new_mag
- the new magnitude value.
getOutputString
public java.lang.String getOutputString()
- Returns a string representation of the state of this object.
- Returns:
- a string representation of the state of this object.
getOutputStrings
public java.lang.String[] getOutputStrings()
- Returns an array of string representations of the state of
stars contained in this object. In general, it only returns a
string representation of the state of only this object itself,
except for
UnifiedStar
and BlendingStar
,
the subclasses of Star
.
- Returns:
- an array of string representations.
paramString
protected java.lang.String paramString()
- Returns a raw string representation of the state of this object,
for debugging use. It should be invoked from
toString
method of the subclasses.
- Overrides:
- paramString in class Position
- Returns:
- a string representation of the state of this object.
toString
public java.lang.String toString()
- Returns a string representation of the state of this object,
for debugging use.
- Overrides:
- toString in class Position
- Returns:
- a string representation of the state of this object.