org.jface.stepmt.core
Interface Pattern

All Known Implementing Classes:
AbstractPattern

public interface Pattern

Patterns are used to test, if a String matches a certain character pattern at a distinct position. Use match(String, int) to determine, if this Pattern matches the given String at the given index.

For example a Pattern matches only numbers will return new Integer(4, 2) at pattern.match("Nr. 13", 4);.

Version:
$Id: Pattern.java,v 1.2 2004/02/07 11:24:11 powerpete Exp $
Author:
Moritz Petersen

Method Summary
 java.lang.String getName()
          Returns the name of this Pattern.
 Interval match(java.lang.String str, int index)
          Returns the Interval matching this pattern at the given index.
 void setName(java.lang.String name)
          Sets the name of this Pattern.
 

Method Detail

match

public Interval match(java.lang.String str,
                      int index)
Returns the Interval matching this pattern at the given index.

Parameters:
str - The String
index - The index that is used to match the position.
Returns:
The Interval matchin this Pattern or null.

getName

public java.lang.String getName()
Returns the name of this Pattern.

Returns:
The name.

setName

public void setName(java.lang.String name)
Sets the name of this Pattern.

Parameters:
name - The name.


Copyright © 2003-2004 jface.org. All Rights Reserved.