Top Fields Constructors Methods
com.jogamp.nativewindow.util

public Class Dimension

extends Object
implements Cloneable, DimensionImmutable
Class Inheritance
All Implemented Interfaces
com.jogamp.nativewindow.util.DimensionImmutable, java.lang.Comparable, com.jogamp.common.type.WriteCloneable, java.lang.Cloneable

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
public
Dimension(final int[] size)

public
Dimension(final int width, final int height)

Method Summary

Modifier and TypeMethod and Description
public final Dimension
add(final Dimension pd)

public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
public Object
cloneMutable()

Implements com.jogamp.common.type.WriteCloneable.cloneMutable.

Get a mutable clone from this instance.
public int
compareTo(final DimensionImmutable
the object to be compared.
d
)

Implements com.jogamp.nativewindow.util.DimensionImmutable.compareTo.

Compares square of size.

public boolean
equals(final Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Implements com.jogamp.nativewindow.util.DimensionImmutable.equals.

Checks whether two dimensions objects are equal.
public final int
public final int
public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements com.jogamp.nativewindow.util.DimensionImmutable.hashCode.

Returns a hash code value for this object.
public final Dimension
scale(final int s)

public final void
set(final int width, final int height)

public final void
setHeight(final int height)

public final void
setWidth(final int width)

public String
toString()

Overrides java.lang.Object.toString.

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

Field Detail

heightback to summary
pack-priv int height
widthback to summary
pack-priv int width

Constructor Detail

Dimensionback to summary
public Dimension()
Dimensionback to summary
public Dimension(final int[] size)
Dimensionback to summary
public Dimension(final int width, final int height)

Method Detail

addback to summary
public final Dimension add(final Dimension pd)
cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:Object

a clone of this instance.

Annotations
@Override
cloneMutableback to summary
public Object cloneMutable()

Implements com.jogamp.common.type.WriteCloneable.cloneMutable.

Doc from com.jogamp.common.type.WriteCloneable.cloneMutable.

Get a mutable clone from this instance.

Annotations
@Override
compareToback to summary
public int compareTo(final DimensionImmutable d)

Implements com.jogamp.nativewindow.util.DimensionImmutable.compareTo.

Doc from com.jogamp.nativewindow.util.DimensionImmutable.compareTo.

Compares square of size.

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
d:DimensionImmutable

Doc from java.lang.Comparable.compareTo.

the object to be compared.

Returns:int

Doc from java.lang.Comparable.compareTo.

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 boolean equals(final Object obj)

Overrides java.lang.Object.equals.

Implements com.jogamp.nativewindow.util.DimensionImmutable.equals.

Doc from com.jogamp.nativewindow.util.DimensionImmutable.equals.

Checks whether two dimensions objects are equal. Two instances of DimensionReadOnly are equal if two components height and width 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
getHeightback to summary
public final int getHeight()

Implements com.jogamp.nativewindow.util.DimensionImmutable.getHeight.

Annotations
@Override
getWidthback to summary
public final int getWidth()

Implements com.jogamp.nativewindow.util.DimensionImmutable.getWidth.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements com.jogamp.nativewindow.util.DimensionImmutable.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
scaleback to summary
public final Dimension scale(final int s)
setback to summary
public final void set(final int width, final int height)
setHeightback to summary
public final void setHeight(final int height)
setWidthback to summary
public final void setWidth(final int width)
toStringback to summary
public 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