Package org.jruby.util
Class RegexpOptions
java.lang.Object
org.jruby.util.RegexpOptions
- All Implemented Interfaces:
Cloneable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
static RegexpOptions
fromByteList
(Ruby runtime, ByteList string) static RegexpOptions
fromByteList
(ThreadContext context, ByteList string) static RegexpOptions
fromEmbeddedOptions
(int embeddedOptions) static RegexpOptions
fromJoniOptions
(int joniOptions) getKCode()
int
hashCode()
boolean
boolean
boolean
boolean
isFixed()
boolean
boolean
isJava()
boolean
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
boolean
boolean
isOnce()
static RegexpOptions
newRegexpOptions
(String validOptions) 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
Calculate the encoding based on kcode option set via 'nesu'.int
This int value can be used by compiler or any place where we want an integer representation of the state of this object.int
This int value is meant to only be used when dealing directly with the joni regular expression library.int
This int value is used by Regex#optionstoString()
-
Field Details
-
NULL_OPTIONS
-
-
Constructor Details
-
RegexpOptions
public RegexpOptions() -
RegexpOptions
-
-
Method Details
-
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
-
getKCodeName
-
setExplicitKCode
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() -
setup
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. Note: This is for full representation of state in the JIT. It is not to be confused with state of marshalled regexp data. -
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. -
toOptions
public int toOptions()This int value is used by Regex#options -
fromEmbeddedOptions
-
fromJoniOptions
-
fromByteList
-
fromByteList
-
withoutOnce
-
hashCode
public int hashCode() -
clone
-
equals
-
toString
-
newRegexpOptions
-