|
Summary: The RegExQuery class is used to query the space using the Java Regular Expression syntax.
OverviewThe RegExQuery class is used to query the space using the Java Regular Expression syntax. Constructors
MethodsThe RegExQuery includes the following methods:
Supported JavaSpace MethodsRead (), take (), readIfExists (), takeIfExists (), readMultiple (), takeMultiple (), notify () with NO_WAIT timeout. Non-Supported methodsNotify (), readIfExists (), takeIfExists (), read (), take (), readMultiple (), takeMultiple () with timeout greater than NO_WAIT. Code exampleEntry ClassWe will use the following Entry class as part of the code examples: public class MyEntry implements Entry{ public MyEntry() {} public String m_string = null; public Long m_long= null; public Time m_time= null; public Date m_date= null; public Integer m_integer= null; Caching Regular ExpressionsThe space maintains a cache for pre-compiled regular expressions. You can control this cache size using the <regular-expressions-cache-size> space configuration file parameter: <regular-expressions-cache-size>300</regular-expressions-cache-size> Using RegExQuery with readMultiple ()RegExQuery regExQuery = new RegExQuery(MyEntry.class.getName(), new String[]{"m_string"}, new String[]{"a*b"}); Entry result[] = space.readMultiple(regExQuery, null, Integer.MAX_VALUE); Using RegExQuery with NotifyDelegator ()RegExQuery m_Template =new RegExQuery(new MyEntry(),new String[]{"m_string"}, new String[]{"a*b"}); m_NotifyDelegator = new NotifyDelegator(space, m_Template, null, this, Lease.FOREVER, null, false, NotifyModifiers.NOTIFY_ALL);
|
(works on Firefox 2 and Internet Explorer 7)