Extension SDK 10.1.2

oracle.ide.model
Class DefaultAttributes

java.lang.Object
  extended byoracle.ide.model.DefaultAttributes
All Implemented Interfaces:
Attributes
Direct Known Subclasses:
CellRendererAttributes, ElementAttributes

public abstract class DefaultAttributes
extends java.lang.Object
implements Attributes

This class encapsulates the notion of attributes, which is a collection of boolean flags. The DefaultAttributes class represents each flag as an int. The state of each flag can be tested, set, and unset (i.e. cleared).

Client classes of DefaultAttributes must not make any assumptions about the meaning of the int that represents a particular flag. There is no guarantee that the DefaultAttributes implementation will behave as a bitset, array of ints, or otherwise. The reason is that the implementation of DefaultAttributes may change without notice to address scaling or performance issues. The only safe ways to query and modify an DefaultAttributes instance is through its methods.

Special care must be taken when implementing subclasses of DefaultAttributes to avoid the tendency to depend on the implementation details of a superclass.


Field Summary
static Attributes EMPTY_ATTRIBUTES
          Classes that define no attributes should use EMPTY_ATTRIBUTES
static int NONE
          NONE is used to represent that no attributes are set.
 
Constructor Summary
DefaultAttributes()
          Creates a new Attributes object initialized with all attributes unset.
DefaultAttributes(DefaultAttributes attributes)
           
DefaultAttributes(int attribute)
          Creates a new Attributes object initialized with the specified attribute set.
 
Method Summary
 void clear()
          Clears all attributes by resetting the attributes to Attributes.NONE.
protected static int decAttr(int curAttr)
          The caller must not make any assumptions about the format of the returned int and how the Attributes class uses it.
 boolean equals(java.lang.Object o)
           
protected  boolean equalsImpl(DefaultAttributes other)
           
protected static int incAttr(int curAttr)
          The caller must not make any assumptions about the format of the returned int and how the Attributes class uses it.
 boolean isSet(int attr)
           
protected static int maxAttr()
          The caller must not make any assumptions about the format of the returned int and how the Attributes class uses it.
protected static int minAttr()
          The caller must not make any assumptions about the format of the returned int and how the Attributes class uses it.
protected static int noneAttr()
          The caller must not make any assumptions about the format of the returned int and how the Attributes class uses it.
 void set(int attr)
          This method sets the specified attribute.
 void unset(int attr)
          This method unsets (i.e.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.ide.model.Attributes
duplicate
 

Field Detail

EMPTY_ATTRIBUTES

public static final Attributes EMPTY_ATTRIBUTES
Classes that define no attributes should use EMPTY_ATTRIBUTES


NONE

public static final int NONE
NONE is used to represent that no attributes are set.

Constructor Detail

DefaultAttributes

public DefaultAttributes()
Creates a new Attributes object initialized with all attributes unset.


DefaultAttributes

public DefaultAttributes(int attribute)
Creates a new Attributes object initialized with the specified attribute set.


DefaultAttributes

public DefaultAttributes(DefaultAttributes attributes)
Method Detail

isSet

public boolean isSet(int attr)
Specified by:
isSet in interface Attributes

set

public void set(int attr)
This method sets the specified attribute. If the specified attribute represents an immutable attribute, then this method returns without doing anything.

Specified by:
set in interface Attributes

unset

public void unset(int attr)
This method unsets (i.e. clears) the specified attribute. If the specified attribute represents an immutable attribute, then this method returns without doing anything.

Specified by:
unset in interface Attributes

clear

public void clear()
Clears all attributes by resetting the attributes to Attributes.NONE.

Specified by:
clear in interface Attributes

noneAttr

protected static final int noneAttr()
The caller must not make any assumptions about the format of the returned int and how the Attributes class uses it. The implementation may change without notice to address scaling or performance issues.


minAttr

protected static final int minAttr()
The caller must not make any assumptions about the format of the returned int and how the Attributes class uses it. The implementation may change without notice to address scaling or performance issues.


maxAttr

protected static final int maxAttr()
The caller must not make any assumptions about the format of the returned int and how the Attributes class uses it. The implementation may change without notice to address scaling or performance issues.


incAttr

protected static final int incAttr(int curAttr)
The caller must not make any assumptions about the format of the returned int and how the Attributes class uses it. The implementation may change without notice to address scaling or performance issues.


decAttr

protected static final int decAttr(int curAttr)
The caller must not make any assumptions about the format of the returned int and how the Attributes class uses it. The implementation may change without notice to address scaling or performance issues.


equals

public boolean equals(java.lang.Object o)

equalsImpl

protected final boolean equalsImpl(DefaultAttributes other)

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.