public class

MapRange

extends Object
java.lang.Object
   ↳ com.carto.core.MapRange

Class Overview

A container class that defines a half closed range of values using minimum and maximum values.

Summary

Public Constructors
MapRange()
Constructs a MapRange object.
MapRange(float min, float max)
Constructs a MapRange object from min and max values.
Public Methods
synchronized void delete()
boolean equals(Object obj)
Checks if this object is equal to the specified object.
float getMax()
Returns the max value of this map range.
float getMidrange()
Calculate the midrange value.
float getMin()
Returns the min value of this map range.
int hashCode()
Returns the hash value of this object.
boolean inRange(float value)
Tests if a value is in this map range.
float length()
Calculates the length of this map range.
String toString()
Creates a string representation of this map range, useful for logging.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MapRange ()

Constructs a MapRange object. The minimum value will be set to positive infinity
and the maximum value to negative infinity.

public MapRange (float min, float max)

Constructs a MapRange object from min and max values.
If min > max, the values will be swapped internally.

Parameters
min The min value.
max The max value.

Public Methods

public synchronized void delete ()

public boolean equals (Object obj)

Checks if this object is equal to the specified object.

Parameters
obj The reference object.
Returns
  • True when objects are equal, false otherwise.

public float getMax ()

Returns the max value of this map range.

Returns
  • The max value of this map range.

public float getMidrange ()

Calculate the midrange value.

Returns
  • The midrange value.

public float getMin ()

Returns the min value of this map range.

Returns
  • The min value of this map range.

public int hashCode ()

Returns the hash value of this object.

Returns
  • The hash value of this object.

public boolean inRange (float value)

Tests if a value is in this map range. Value is considered in range if min <= val < max.

Parameters
value The value to be tested.
Returns
  • True if value is in this map range.

public float length ()

Calculates the length of this map range. Defined as max - min.

Returns
  • The length of this map range.

public String toString ()

Creates a string representation of this map range, useful for logging.

Returns
  • The string representation of this map range.