Location class java lang object

Interface Location

A point within the executing code of the target VM. Locations are used to identify the current position of a suspended thread (analogous to an instruction pointer or program counter register in native programs). They are also used to identify the position at which to set a breakpoint.

The availability of a line number for a location will depend on the level of debugging information available from the target VM.

Several mirror interfaces have locations. Each such mirror extends a Locatable interface.

The source information for a Location is dependent on the stratum which is used. A stratum is a source code level within a sequence of translations. For example, say the baz program is written in the programming language «Foo» then translated to the language «Bar» and finally translated into the Java programming language. The Java programming language stratum is named «Java» , let’s say the other strata are named «Foo» and «Bar». A given location (as viewed by the sourceName() and lineNumber() methods) might be at line 14 of «baz.foo» in the «Foo» stratum, line 23 of «baz.bar» in the «Bar» stratum and line 71 of the «Java» stratum. Note that while the Java programming language may have only one source file for a reference type, this restriction does not apply to other strata — thus each Location should be consulted to determine its source path. Queries which do not specify a stratum ( sourceName() , sourcePath() and lineNumber() ) use the VM’s default stratum ( VirtualMachine.getDefaultStratum() ). If the specified stratum (whether explicitly specified by a method parameter or implicitly as the VM’s default) is null or is not available in the declaring type, the declaring type’s default stratum is used ( declaringType() . defaultStratum() ). Note that in the normal case, of code that originates as Java programming language source, there will be only one stratum ( «Java» ) and it will be returned as the default. To determine the available strata use ReferenceType.availableStrata() .

Читайте также:  Php implode returns array

Источник

Interface Location

A point within the executing code of the target VM. Locations are used to identify the current position of a suspended thread (analogous to an instruction pointer or program counter register in native programs). They are also used to identify the position at which to set a breakpoint.

The availability of a line number for a location will depend on the level of debugging information available from the target VM.

Several mirror interfaces have locations. Each such mirror extends a Locatable interface.

The source information for a Location is dependent on the stratum which is used. A stratum is a source code level within a sequence of translations. For example, say the baz program is written in the programming language «Foo» then translated to the language «Bar» and finally translated into the Java programming language. The Java programming language stratum is named «Java» , let’s say the other strata are named «Foo» and «Bar». A given location (as viewed by the sourceName() and lineNumber() methods) might be at line 14 of «baz.foo» in the «Foo» stratum, line 23 of «baz.bar» in the «Bar» stratum and line 71 of the «Java» stratum. Note that while the Java programming language may have only one source file for a reference type, this restriction does not apply to other strata — thus each Location should be consulted to determine its source path. Queries which do not specify a stratum ( sourceName() , sourcePath() and lineNumber() ) use the VM’s default stratum ( VirtualMachine.getDefaultStratum() ). If the specified stratum (whether explicitly specified by a method parameter or implicitly as the VM’s default) is null or is not available in the declaring type, the declaring type’s default stratum is used ( declaringType() . defaultStratum() ). Note that in the normal case, of code that originates as Java programming language source, there will be only one stratum ( «Java» ) and it will be returned as the default. To determine the available strata use ReferenceType.availableStrata() .

Источник

Location class java lang object

Represents a 3-dimensional position in a world.
No constraints are placed on any angular values other than that they be specified in degrees. This means that negative angles or angles of greater magnitude than 360 are valid, but may be normalized to any other equivalent representation by the implementation.

Constructor Summary

Method Summary

Gets the floored value of the X component, indicating the block that this location is contained with.

Gets the floored value of the Y component, indicating the block that this location is contained with.

Gets the floored value of the Z component, indicating the block that this location is contained with.

Methods inherited from class java.lang.Object

Constructor Detail

Location

public Location​(World world, double x, double y, double z)

Location

public Location​(World world, double x, double y, double z, float yaw, float pitch)

Method Detail

setWorld

getWorld

getChunk

getBlock

setX

getX

getBlockX

Gets the floored value of the X component, indicating the block that this location is contained with.

setY

getY

getBlockY

Gets the floored value of the Y component, indicating the block that this location is contained with.

setZ

getZ

getBlockZ

Gets the floored value of the Z component, indicating the block that this location is contained with.

setYaw

public void setYaw​(float yaw)
  • A yaw of 0 or 360 represents the positive z direction.
  • A yaw of 180 represents the negative z direction.
  • A yaw of 90 represents the negative x direction.
  • A yaw of 270 represents the positive x direction.

getYaw

  • A yaw of 0 or 360 represents the positive z direction.
  • A yaw of 180 represents the negative z direction.
  • A yaw of 90 represents the negative x direction.
  • A yaw of 270 represents the positive x direction.

setPitch

public void setPitch​(float pitch)
  • A pitch of 0 represents level forward facing.
  • A pitch of 90 represents downward facing, or negative y direction.
  • A pitch of -90 represents upward facing, or positive y direction.

getPitch

  • A pitch of 0 represents level forward facing.
  • A pitch of 90 represents downward facing, or negative y direction.
  • A pitch of -90 represents upward facing, or positive y direction.

getDirection

setDirection

public Location setDirection​(Vector vector)

add

add

add

public Location add​(double x, double y, double z)

subtract

subtract

subtract

public Location subtract​(double x, double y, double z)

length

Gets the magnitude of the location, defined as sqrt(x^2+y^2+z^2). The value of this method is not cached and uses a costly square-root function, so do not repeatedly call this method to get the location’s magnitude. NaN will be returned if the inner result of the sqrt() function overflows, which will be caused if the length is too long. Not world-aware and orientation independent.

lengthSquared

public double lengthSquared()

distance

Get the distance between this location and another. The value of this method is not cached and uses a costly square-root function, so do not repeatedly call this method to get the location’s magnitude. NaN will be returned if the inner result of the sqrt() function overflows, which will be caused if the distance is too long.

distanceSquared

multiply

Источник

Location class java lang object

All Implemented Interfaces: java.lang.Cloneable, java.io.Serializable public class Location extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable

This represents a physical location (a longitude/latitude pair).

Constructor Summary
Location (Latitude lat, Longitude lon)
Constructor.
Location (Location loc)
The copy constructor.
Method Summary
java.lang.Object clone ()
This method returns a deep copy of this object.
double distance (Location l)
Get the distance in meters from this location to another location.
boolean equals (java.lang.Object o)
Determines if another object is equal to this location.
Latitude getLatitude ()
Accessor method to the latitude.
Longitude getLongitude ()
Accessor method to the longitude.
double getX ()
Returns the sexagesimal notation of the longitude of this GPS Location
double getY ()
Returns the sexagesimal notation of the latitude of this GPS Location
java.lang.String toString ()
Get a string representation of the location.
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Location


Location


equals

public boolean equals(java.lang.Object o)

getLatitude


getLongitude


getX

Returns the sexagesimal notation of the longitude of this GPS Location Returns: the sexagesimal notation of the longitude of this GPS Location

getY

Returns the sexagesimal notation of the latitude of this GPS Location Returns: the sexagesimal notation of the latitude of this GPS Location

toString

public java.lang.String toString()

Get a string representation of the location. Overrides: toString in class java.lang.Object Returns: the string representation of the location.

distance

Get the distance in meters from this location to another location. The location is obtained by doing a mapping of the degrees longitude and latitude to a linear coordinate system and using the linear distance formula. Parameters: l — the other location Returns: the distance between this location and l in meters.

clone

public java.lang.Object clone()

This method returns a deep copy of this object. Overrides: clone in class java.lang.Object Returns: an object

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Источник

Location class java lang object

Gets the floored value of the X component, indicating the block that this location is contained with.

Gets the floored value of the Y component, indicating the block that this location is contained with.

Gets the floored value of the Z component, indicating the block that this location is contained with.

Methods inherited from class java.lang.Object

Constructor Detail

Location

public Location(World world, double x, double y, double z)

Location

public Location(World world, double x, double y, double z, float yaw, float pitch)

Method Detail

setWorld

getWorld

getChunk

getBlock

setX

getX

getBlockX

Gets the floored value of the X component, indicating the block that this location is contained with.

setY

getY

getBlockY

Gets the floored value of the Y component, indicating the block that this location is contained with.

setZ

getZ

getBlockZ

Gets the floored value of the Z component, indicating the block that this location is contained with.

setYaw

public void setYaw(float yaw)
  • A yaw of 0 or 360 represents the positive z direction.
  • A yaw of 180 represents the negative z direction.
  • A yaw of 90 represents the negative x direction.
  • A yaw of 270 represents the positive x direction.

getYaw

  • A yaw of 0 or 360 represents the positive z direction.
  • A yaw of 180 represents the negative z direction.
  • A yaw of 90 represents the negative x direction.
  • A yaw of 270 represents the positive x direction.

setPitch

public void setPitch(float pitch)
  • A pitch of 0 represents level forward facing.
  • A pitch of 90 represents downward facing, or negative y direction.
  • A pitch of -90 represents upward facing, or positive y direction.

getPitch

  • A pitch of 0 represents level forward facing.
  • A pitch of 90 represents downward facing, or negative y direction.
  • A pitch of -90 represents upward facing, or positive y direction.

getDirection

setDirection

public Location setDirection(Vector vector)

add

add

add

public Location add(double x, double y, double z)

subtract

subtract

subtract

public Location subtract(double x, double y, double z)

length

Gets the magnitude of the location, defined as sqrt(x^2+y^2+z^2). The value of this method is not cached and uses a costly square-root function, so do not repeatedly call this method to get the location’s magnitude. NaN will be returned if the inner result of the sqrt() function overflows, which will be caused if the length is too long. Not world-aware and orientation independent.

lengthSquared

public double lengthSquared()

distance

Get the distance between this location and another. The value of this method is not cached and uses a costly square-root function, so do not repeatedly call this method to get the location’s magnitude. NaN will be returned if the inner result of the sqrt() function overflows, which will be caused if the distance is too long.

distanceSquared

multiply

Источник

Оцените статью