java.awt
Class Insets

java.lang.Object
  extended by java.awt.Insets
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
InsetsUIResource

public class Insets
extends Object
implements Cloneable, Serializable

This class represents the "margin" or space around a container.

See Also:
Serialized Form

Field Summary
 int bottom
          The gap from the bottom.
 int left
          The gap from the left.
 int right
          The gap from the right.
 int top
          The gap from the top.
 
Constructor Summary
Insets(int top, int left, int bottom, int right)
          Initializes a new instance of Inset with the specified inset values.
 
Method Summary
 Object clone()
          Returns a copy of this object.
 boolean equals(Object obj)
          Tests whether this object is equal to the specified object.
 int hashCode()
          Returns a hashcode for this instance.
 void set(int top, int left, int bottom, int right)
          Set the contents of this Insets object to the specified values.
 String toString()
          Returns a string representation of this object, which will be non-null.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

top

public int top
The gap from the top.


left

public int left
The gap from the left.


bottom

public int bottom
The gap from the bottom.


right

public int right
The gap from the right.

Constructor Detail

Insets

public Insets(int top,
              int left,
              int bottom,
              int right)
Initializes a new instance of Inset with the specified inset values.

Parameters:
top - the top inset
left - the left inset
bottom - the bottom inset
right - the right inset
Method Detail

set

public void set(int top,
                int left,
                int bottom,
                int right)
Set the contents of this Insets object to the specified values.

Parameters:
top - the top inset
left - the left inset
bottom - the bottom inset
right - the right inset
Since:
1.5

equals

public boolean equals(Object obj)
Tests whether this object is equal to the specified object. The other object must be an instance of Insets with identical field values.

Overrides:
equals in class Object
Parameters:
obj - the object to test against
Returns:
true if the specified object is equal to this one
Since:
1.1
See Also:
Object.hashCode()

hashCode

public int hashCode()
Returns a hashcode for this instance. The formula is unspecified, but appears to be XXX what is it? .

Overrides:
hashCode in class Object
Returns:
the hashcode
See Also:
Object.equals(Object), System.identityHashCode(Object)

toString

public String toString()
Returns a string representation of this object, which will be non-null.

Overrides:
toString in class Object
Returns:
a string representation of this object
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)

clone

public Object clone()
Returns a copy of this object.

Overrides:
clone in class Object
Returns:
a copy of this object
See Also:
Cloneable