anvil.core
Class AnyPattern

java.lang.Object
  |
  +--anvil.core.Any
        |
        +--anvil.core.AnyPattern
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable

public class AnyPattern
extends Any

class AnyPattern

Author:
Jani Lehtimäki

Field Summary
static NativeClass _class
           
protected  java.util.regex.Pattern _pattern
           
static java.lang.Object[] newInstance
           
static java.lang.Object[] p_contains
           
static java.lang.Object[] p_find
           
static java.lang.Object[] p_matches
           
static java.lang.Object[] p_split
           
static java.lang.Object[] p_substitute
           
static java.lang.Object[] p_substituteFirst
           
 
Fields inherited from class anvil.core.Any
ARRAY0, DOUBLE_MINUS_ONE, DOUBLE_ONE, DOUBLE_ZERO, EMPTY_STRING, EMPTY_TUPLE, FALSE, INF, IS_ARRAY, IS_BINARY, IS_BOOLEAN, IS_BUFFER, IS_CLASS, IS_DOUBLE, IS_ENUMERATION, IS_INF, IS_INT, IS_LIST, IS_MAP, IS_NEG_INF, IS_NULL, IS_PATTERN, IS_RANGE, IS_STRING, IS_TUPLE, IS_UNDEFINED, MINUS_ONE, NAN, NEG_INF, NULL, ONE, p_compareTo, p_each, p_equals, p_pipe, p_select, THREE, TRUE, TWO, UNDEFINED, ZERO
 
Constructor Summary
AnyPattern(java.util.regex.Pattern pattern)
           
 
Method Summary
 ClassType classOf()
          Returns the type of this Any.
static Any create(java.lang.String pattern, java.lang.String flags)
           
 boolean equals(java.lang.Object obj)
          Tests for equality.
 Any execute(Context context)
           
 Any execute(Context context, Any param1)
           
 Any execute(Context context, Any[] parameters)
           
 Any execute(Context context, Any param1, Any param2)
           
 Any execute(Context context, Any param1, Any param2, Any param3)
           
 Any execute(Context context, Any param1, Any param2, Any param3, Any param4)
           
 java.lang.String getFlags()
           
 java.lang.String getPattern()
           
 int hashCode()
           
 boolean isPattern()
          Checks if this any is pattern.
 Any m_contains(Context context, java.lang.String str, Any matches)
           
 Any m_find(java.lang.String text)
           
 Any m_matches(Context context, java.lang.String str, Any matches)
           
 Any m_split(java.lang.String string)
           
 Any m_substitute(Context context, java.lang.String text, Any substitution, Any limit_)
           
 Any m_substituteFirst(Context context, java.lang.String text, Any substitution)
           
static Any newInstance(Context context, java.lang.String pattern, java.lang.String flags)
           
 void serialize(Serializer serializer)
           
 java.io.Writer toAnvil(java.io.Writer writer)
           
 boolean toBoolean()
          Gets the contained value as boolean.
 Code toCode(Code code)
           
 java.lang.Object toObject()
          Gets the contained value as java.lang.Object.
 java.util.regex.Pattern toPattern()
           
 java.lang.String toString()
          Converts contained value into String.
 int typeOf()
          Returns the type of contained value.
static Any unserialize(Unserializer unserializer)
           
 
Methods inherited from class anvil.core.Any
_clone, _copy, _invoke, _invoke, _invoke, _invoke, _invoke, _invoke, _serialize, _unserialize, _wakeup, add, classNameOf, clone, coerce, compare, compareTo, concat, contains, copy, create, create, create, create, create, create, create, create, create, create, create, create, create, create, decrease, deleteAttribute, deleteReference, divide, getAttribute, getRef, getReference, has, increase, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, isArray, isBinary, isBoolean, isBuffer, isDefined, isDouble, isInstanceOf, isInt, isIterator, isList, isMap, isMutable, isNull, isRange, isRef, isSequence, isString, isTuple, isUndefined, iterator, m_clone, m_compareTo, m_copy, m_each, m_equals, m_hashCode, m_pipe, m_select, m_toBoolean, m_toString, minus, modulo, multiply, not, plus, setAttribute, setRef, setReference, setReference, sizeOf, subtract, toAnvil, toAnyBoolean, toAnyDouble, toAnyInt, toAnyString, toArray, toBinary, toBuffer, toByte, toChar, toDouble, toInt, toList, toLong, toMap, toRange, toTuple, type
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

newInstance

public static final java.lang.Object[] newInstance

_pattern

protected java.util.regex.Pattern _pattern

p_matches

public static final java.lang.Object[] p_matches

p_contains

public static final java.lang.Object[] p_contains

p_split

public static final java.lang.Object[] p_split

p_substitute

public static final java.lang.Object[] p_substitute

p_substituteFirst

public static final java.lang.Object[] p_substituteFirst

p_find

public static final java.lang.Object[] p_find

_class

public static final transient NativeClass _class
Constructor Detail

AnyPattern

public AnyPattern(java.util.regex.Pattern pattern)
Method Detail

newInstance

public static final Any newInstance(Context context,
                                    java.lang.String pattern,
                                    java.lang.String flags)

create

public static final Any create(java.lang.String pattern,
                               java.lang.String flags)

typeOf

public int typeOf()
Description copied from class: Any
Returns the type of contained value.

Overrides:
typeOf in class Any
Returns:
Type of this any as int.

isPattern

public boolean isPattern()
Description copied from class: Any
Checks if this any is pattern.

Overrides:
isPattern in class Any
Returns:
true if this is pattern

classOf

public final ClassType classOf()
Description copied from class: Any
Returns the type of this Any.

Overrides:
classOf in class Any

toBoolean

public boolean toBoolean()
Description copied from class: Any
Gets the contained value as boolean. Integer is considered true if it is different from 0. Double is considered true if it is different from 0.0. String is considered true if it contains "true", "on", "yes" or "1".

Overrides:
toBoolean in class Any
Returns:
Value as boolean or false if it can't be transformed.

getPattern

public java.lang.String getPattern()

getFlags

public java.lang.String getFlags()

toString

public java.lang.String toString()
Description copied from class: Any
Converts contained value into String.

Overrides:
toString in class Any
Returns:
Value as String.

toAnvil

public java.io.Writer toAnvil(java.io.Writer writer)
                       throws java.io.IOException
Overrides:
toAnvil in class Any
java.io.IOException

toCode

public Code toCode(Code code)
Overrides:
toCode in class Any

toObject

public java.lang.Object toObject()
Description copied from class: Any
Gets the contained value as java.lang.Object.

Overrides:
toObject in class Any
Returns:
Value as Object.

toPattern

public java.util.regex.Pattern toPattern()
Overrides:
toPattern in class Any

hashCode

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

equals

public boolean equals(java.lang.Object obj)
Description copied from class: Any
Tests for equality.

Overrides:
equals in class Any
Returns:
true if equal, false otherwise.

serialize

public void serialize(Serializer serializer)
               throws java.io.IOException
Overrides:
serialize in class Any
java.io.IOException

unserialize

public static final Any unserialize(Unserializer unserializer)
                             throws UnserializationException
UnserializationException

execute

public Any execute(Context context,
                   Any[] parameters)
Overrides:
execute in class Any

execute

public Any execute(Context context)
Overrides:
execute in class Any

execute

public Any execute(Context context,
                   Any param1)
Overrides:
execute in class Any

execute

public Any execute(Context context,
                   Any param1,
                   Any param2)
Overrides:
execute in class Any

execute

public Any execute(Context context,
                   Any param1,
                   Any param2,
                   Any param3)
Overrides:
execute in class Any

execute

public Any execute(Context context,
                   Any param1,
                   Any param2,
                   Any param3,
                   Any param4)
Overrides:
execute in class Any

m_matches

public Any m_matches(Context context,
                     java.lang.String str,
                     Any matches)

m_contains

public Any m_contains(Context context,
                      java.lang.String str,
                      Any matches)

m_split

public Any m_split(java.lang.String string)

m_substitute

public Any m_substitute(Context context,
                        java.lang.String text,
                        Any substitution,
                        Any limit_)

m_substituteFirst

public Any m_substituteFirst(Context context,
                             java.lang.String text,
                             Any substitution)

m_find

public Any m_find(java.lang.String text)