org.jruby.util
Class IdUtil

java.lang.Object
  extended by org.jruby.util.IdUtil

public final class IdUtil
extends java.lang.Object


Field Summary
static int CLASS_VAR
           
static int CONSTANT
           
static int GLOBAL_VAR
           
static int INSTANCE_VAR
           
static int LOCAL_VAR
           
 
Constructor Summary
IdUtil()
           
 
Method Summary
static int getVarType(java.lang.String id)
          Get type of variable based on Ruby naming conventions.
static boolean isAttrSet(java.lang.String id)
           
static boolean isClassVariable(java.lang.String id)
          rb_is_class_id and is_class_id
static boolean isConstant(java.lang.String id)
          rb_is_const_id and is_const_id
static boolean isGlobal(java.lang.String id)
          rb_is_global_id and is_global_id
static boolean isInstanceVariable(java.lang.String id)
          rb_is_instance_id and is_instance_id
static boolean isLocal(java.lang.String id)
          rb_is_local_id and is_local_id
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSTANT

public static final int CONSTANT
See Also:
Constant Field Values

INSTANCE_VAR

public static final int INSTANCE_VAR
See Also:
Constant Field Values

CLASS_VAR

public static final int CLASS_VAR
See Also:
Constant Field Values

GLOBAL_VAR

public static final int GLOBAL_VAR
See Also:
Constant Field Values

LOCAL_VAR

public static final int LOCAL_VAR
See Also:
Constant Field Values
Constructor Detail

IdUtil

public IdUtil()
Method Detail

getVarType

public static int getVarType(java.lang.String id)
Get type of variable based on Ruby naming conventions. This is useful when you know you are going to want to know what type it is. It should in theory be cheaper than calling all the isFoo methods seperately. It also should be faster than isLocal.

Parameters:
id - the name to determine its type from
Returns:
value representing the type.

isConstant

public static boolean isConstant(java.lang.String id)
rb_is_const_id and is_const_id


isClassVariable

public static boolean isClassVariable(java.lang.String id)
rb_is_class_id and is_class_id


isInstanceVariable

public static boolean isInstanceVariable(java.lang.String id)
rb_is_instance_id and is_instance_id


isGlobal

public static boolean isGlobal(java.lang.String id)
rb_is_global_id and is_global_id


isLocal

public static boolean isLocal(java.lang.String id)
rb_is_local_id and is_local_id


isAttrSet

public static boolean isAttrSet(java.lang.String id)


Copyright © 2002-2007 JRuby Team. All Rights Reserved.