de.hunsicker.jalopy.language
Class ModifierType

java.lang.Object
  |
  +--de.hunsicker.jalopy.language.ModifierType
All Implemented Interfaces:
java.lang.Comparable, Type

public class ModifierType
extends java.lang.Object
implements java.lang.Comparable, Type

Represents a Java modifier.

Version:
$Revision: 1.2.2.2 $
Author:
Marco Hunsicker

Field Summary
static ModifierType ABSTRACT
          Represents the abstract modifier.
static ModifierType FINAL
          Represents the final modifier.
static int MASK
           
static ModifierType NATIVE
          Represents the native modifier.
static ModifierType PRIVATE
          Represents the private modifier.
static ModifierType PROTECTED
          Represents the protected modifier.
static ModifierType PUBLIC
          Represents the public modifier.
static ModifierType STATIC
          Represents the static modifier.
static ModifierType STRICTFP
          Represents the strictfp modifier.
static ModifierType SYNCHRONIZED
          Represents the synchronized modifier.
static ModifierType TRANSIENT
          Represents the transient modifier.
static ModifierType VOLATILE
          Represents the volatile modifier.
 
Method Summary
 int compareTo(java.lang.Object other)
          Compares this object with the specified object for order.
 java.lang.String getName()
          Returns the name of this type.
static java.lang.String getOrder()
          Returns a string representation of the current sort order.
 boolean getSort()
           
static void setOrder(java.lang.String str)
          Sets the order to use as the natural order.
 boolean shouldSort(int mod)
           
 java.lang.String toString()
          Returns a string representation of this modifier type.
static ModifierType valueOf(int mod)
           
static ModifierType valueOf(java.lang.String name)
          Returns the modifier type for the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PUBLIC

public static final ModifierType PUBLIC
Represents the public modifier.


PROTECTED

public static final ModifierType PROTECTED
Represents the protected modifier.


PRIVATE

public static final ModifierType PRIVATE
Represents the private modifier.


STATIC

public static final ModifierType STATIC
Represents the static modifier.


FINAL

public static final ModifierType FINAL
Represents the final modifier.


TRANSIENT

public static final ModifierType TRANSIENT
Represents the transient modifier.


NATIVE

public static final ModifierType NATIVE
Represents the native modifier.


ABSTRACT

public static final ModifierType ABSTRACT
Represents the abstract modifier.


SYNCHRONIZED

public static final ModifierType SYNCHRONIZED
Represents the synchronized modifier.


VOLATILE

public static final ModifierType VOLATILE
Represents the volatile modifier.


STRICTFP

public static final ModifierType STRICTFP
Represents the strictfp modifier.


MASK

public static final int MASK
See Also:
Constant Field Values
Method Detail

getName

public java.lang.String getName()
Returns the name of this type.

Returns:
type name.

setOrder

public static void setOrder(java.lang.String str)
Sets the order to use as the natural order.

Parameters:
str - a string representing the new order. The string must consist of exactly elevene different, comma delimited strings which represents a modifier type.
Throws:
java.lang.IllegalArgumentException - if the given string is invalid.

getSort

public boolean getSort()

getOrder

public static java.lang.String getOrder()
Returns a string representation of the current sort order. To encode the different declaration types, use
 public,protected,private,abstract,static,final,synchronized,transient,volatile,native,strictfp
 
or any combination thereof.

Returns:
the string representation of the order.

compareTo

public int compareTo(java.lang.Object other)
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.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
other - the object to be compared.
Returns:
DOCUMENT ME!
Throws:
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this object.

toString

public java.lang.String toString()
Returns a string representation of this modifier type.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this type.

shouldSort

public boolean shouldSort(int mod)

valueOf

public static final ModifierType valueOf(int mod)

valueOf

public static ModifierType valueOf(java.lang.String name)
Returns the modifier type for the given name.

Parameters:
name - a modifier.
Returns:
the modifier type of the given name.
Throws:
java.lang.IllegalArgumentException - if no valid modifier was given.


Copyright © 1997-2005 Jalopy. All Rights Reserved.