Top Description Fields Constructors Methods
com.jogamp.nativewindow.util

public Class SurfaceSize

extends Object
implements Comparable<SurfaceSize>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable

Immutable SurfaceSize Class, consisting of it's read only components:

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final DimensionImmutable

Constructor Summary

AccessConstructor and Description
public
SurfaceSize(final DimensionImmutable resolution, final int bitsPerPixel)

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(final SurfaceSize
the object to be compared.
ssz
)

Implements java.lang.Comparable.compareTo.

Compares resolution 1st, if equal the bitsPerPixel.

public final boolean

Returns:

true if the two dimensions are equal; otherwise false.
equals
(final Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Checks whether two size objects are equal.
public final int
public final DimensionImmutable
getResolution()

Returns the resolution in pixel units

public final int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.
public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

bitsPerPixelback to summary
pack-priv final int bitsPerPixel
resolutionback to summary
pack-priv final DimensionImmutable resolution

Constructor Detail

SurfaceSizeback to summary
public SurfaceSize(final DimensionImmutable resolution, final int bitsPerPixel)

Method Detail

compareToback to summary
public int compareTo(final SurfaceSize ssz)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares resolution 1st, if equal the bitsPerPixel.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
ssz:SurfaceSize

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
equalsback to summary
public final boolean equals(final Object obj)

Overrides java.lang.Object.equals.

Checks whether two size objects are equal. Two instances of SurfaceSize are equal if the two components resolution and bitsPerPixel are equal.

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

true if the two dimensions are equal; otherwise false.

Annotations
@Override
getBitsPerPixelback to summary
public final int getBitsPerPixel()
getResolutionback to summary
public final DimensionImmutable getResolution()

Returns the resolution in pixel units

hashCodeback to summary
public final int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override