org.jruby.util
Class RegexpOptions

java.lang.Object
  extended by org.jruby.util.RegexpOptions
All Implemented Interfaces:
java.lang.Cloneable

public class RegexpOptions
extends java.lang.Object
implements java.lang.Cloneable


Field Summary
static RegexpOptions NULL_OPTIONS
           
 
Constructor Summary
RegexpOptions()
           
RegexpOptions(KCode kcode, boolean isKCodeDefault)
           
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object other)
           
static RegexpOptions fromEmbeddedOptions(int embeddedOptions)
           
static RegexpOptions fromJoniOptions(int joniOptions)
           
 KCode getKCode()
           
 java.lang.String getKCodeName()
           
 int hashCode()
           
 boolean isEmbeddable()
           
 boolean isEncodingNone()
           
 boolean isExtended()
           
 boolean isFixed()
           
 boolean isIgnorecase()
           
 boolean isJava()
           
 boolean isKcodeDefault()
          Whether the kcode associated with this regexp is implicit (aka default) or is specified explicitly (via 'nesu' syntax postscript or flags to Regexp.new.
 boolean isLiteral()
           
 boolean isMultiline()
           
 boolean isOnce()
           
 void setEncodingNone(boolean encodingNone)
           
 void setExplicitKCode(KCode kcode)
          This regexp has an explicit encoding flag or 'nesu' letter associated with it.
 void setExtended(boolean extended)
           
 void setFixed(boolean fixed)
           
 void setIgnorecase(boolean ignorecase)
           
 void setJava(boolean java)
           
 void setLiteral(boolean literal)
           
 void setMultiline(boolean multiline)
           
 void setOnce(boolean once)
           
 org.jcodings.Encoding setup19(Ruby runtime)
          Calculate the encoding based on kcode option set via 'nesu'.
 int toEmbeddedOptions()
          This int value can be used by compiler or any place where we want an integer representation of the state of this object.
 int toJoniOptions()
          This int value is meant to only be used when dealing directly with the joni regular expression library.
 java.lang.String toString()
           
 RegexpOptions withoutOnce()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_OPTIONS

public static final RegexpOptions NULL_OPTIONS
Constructor Detail

RegexpOptions

public RegexpOptions()

RegexpOptions

public RegexpOptions(KCode kcode,
                     boolean isKCodeDefault)
Method Detail

isExtended

public boolean isExtended()

setExtended

public void setExtended(boolean extended)

isIgnorecase

public boolean isIgnorecase()

setIgnorecase

public void setIgnorecase(boolean ignorecase)

isFixed

public boolean isFixed()

setFixed

public void setFixed(boolean fixed)

getKCode

public KCode getKCode()

getKCodeName

public java.lang.String getKCodeName()

setExplicitKCode

public void setExplicitKCode(KCode kcode)
This regexp has an explicit encoding flag or 'nesu' letter associated with it.

Parameters:
kcode - to be set

isKcodeDefault

public boolean isKcodeDefault()
Whether the kcode associated with this regexp is implicit (aka default) or is specified explicitly (via 'nesu' syntax postscript or flags to Regexp.new.


isMultiline

public boolean isMultiline()

setMultiline

public void setMultiline(boolean multiline)

isOnce

public boolean isOnce()

setOnce

public void setOnce(boolean once)

isJava

public boolean isJava()

setJava

public void setJava(boolean java)

isEncodingNone

public boolean isEncodingNone()

setEncodingNone

public void setEncodingNone(boolean encodingNone)

isLiteral

public boolean isLiteral()

setLiteral

public void setLiteral(boolean literal)

isEmbeddable

public boolean isEmbeddable()

setup19

public org.jcodings.Encoding setup19(Ruby runtime)
Calculate the encoding based on kcode option set via 'nesu'. Also as side-effects: 1.set whether this marks the soon to be made regexp as 'fixed'. 2.kcode.none will set 'none' option

Returns:
null if no explicit encoding is specified.

toEmbeddedOptions

public int toEmbeddedOptions()
This int value can be used by compiler or any place where we want an integer representation of the state of this object.


toJoniOptions

public int toJoniOptions()
This int value is meant to only be used when dealing directly with the joni regular expression library. It differs from embeddedOptions in that it only contains bit values which Joni cares about.


fromEmbeddedOptions

public static RegexpOptions fromEmbeddedOptions(int embeddedOptions)

fromJoniOptions

public static RegexpOptions fromJoniOptions(int joniOptions)

withoutOnce

public RegexpOptions withoutOnce()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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