sears.search.data
Class Window

java.lang.Object
  extended by sears.search.data.Window
All Implemented Interfaces:
java.lang.Cloneable

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

Iterator class for manage int array of char index


Constructor Summary
Window()
          Constructs an empty window
Window(java.lang.String text, java.lang.String str)
          Constructs a window with parameters given
 
Method Summary
 java.lang.Object clone()
           
 Window getEmptyClonedWindow()
          Returns an empty cloned Window object or a new instance if clone method failed
 int getNextCharIndex()
          A char index is always positive, this method returns the next char index
 int getPreviousCharIndex()
          A char index is always positive, this method returns the previous char index
 void setWindowForGettingNextElement(java.lang.String text, java.lang.String str)
          Sets a new window
 void setWindowForGettingPreviousElement(java.lang.String text, java.lang.String str)
          Sets a new window
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Window

public Window()
Constructs an empty window


Window

public Window(java.lang.String text,
              java.lang.String str)
Constructs a window with parameters given

Parameters:
text - the text
str - the str to search in text
Method Detail

setWindowForGettingNextElement

public void setWindowForGettingNextElement(java.lang.String text,
                                           java.lang.String str)
Sets a new window

Parameters:
text - the text
str - the string to search in text

setWindowForGettingPreviousElement

public void setWindowForGettingPreviousElement(java.lang.String text,
                                               java.lang.String str)
Sets a new window

Parameters:
text - the text
str - the string to search in text

getNextCharIndex

public int getNextCharIndex()
A char index is always positive, this method returns the next char index

Returns:
the next char index or -1 if there's no next char index

getPreviousCharIndex

public int getPreviousCharIndex()
A char index is always positive, this method returns the previous char index

Returns:
the previous char index or -1 if there's no previous char index

clone

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

getEmptyClonedWindow

public Window getEmptyClonedWindow()
Returns an empty cloned Window object or a new instance if clone method failed

Returns:
an empty cloned Window object