POGO Java Program


pogo.gene
Class PogoString

java.lang.Object
  |
  +--pogo.gene.PogoString

public class PogoString
extends java.lang.Object

This class is used as a java.lang.String with other methods. These methods are some of ones that seems to be missed in String Class.


Field Summary
 java.lang.String str
           
 
Constructor Summary
PogoString(byte[] b)
          Constructor.
PogoString(java.lang.String str)
          Constructor.
 
Method Summary
 void append(java.lang.String newStr)
          Append a new string at the end of this object.
 java.lang.String buildDescClassFromPath(int lang)
          Build class description file name from a full path string.
 java.lang.String buildServerClassFromPath()
          Build server class file name from a full path string.
 java.lang.String extractClassFromPath()
          Extract class name from a full path string.
 java.lang.String extractMethodCore()
          Extract the first method core found.
 java.lang.String extractMethodCore(int start)
          Extract the first method core found.
 java.lang.String extractPathFromFullPath()
          Build class description file name from a full path string.
 java.lang.String getDescription()
          extract the description text from comments.
 java.lang.String[] getFields()
          Extract fields of 'C' structure string.
 java.lang.String[] getParams()
          Extract params of a method call string.
 int inMethod(int start)
          Search index of next entry of the method.
 void insert(int idx, java.lang.String s)
          Insert a new String in PogoString Object.
 int inTest(int start)
          Search index of next test.
 int nextCr(int start)
          Search index of next '\n'.
 java.lang.String noEdges()
           
 java.lang.String noEdges(int start)
           
 int outMethod(int start)
          Search index of next out of the method.
 int outTest(int start)
          Search index of the end of the test.
 int previousCr(int start)
          Search index of previous '\n'.
 void replace(int start, java.lang.String pattern, java.lang.String newOne)
          replace the first pattern found by a new String.
 void replace(java.lang.String pattern, java.lang.String newOne)
          replace the first pattern found by a new String.
 java.lang.String setComments()
          Convert the string to a javadoc or doc++ comment.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

str

public java.lang.String str
Constructor Detail

PogoString

public PogoString(java.lang.String str)
Constructor.
Parameters:
str - The string to work

PogoString

public PogoString(byte[] b)
Constructor.
Parameters:
b - The byte array will be converted in string to work
Method Detail

previousCr

public int previousCr(int start)
Search index of previous '\n'.
Parameters:
start - index to start search.
Returns:
index of previous '\n'.

nextCr

public int nextCr(int start)
Search index of next '\n'.
Parameters:
start - index to start search.
Returns:
index of next '\n'.

inTest

public int inTest(int start)
Search index of next test.
Parameters:
start - index to start search.
Returns:
index of next test

outTest

public int outTest(int start)
Search index of the end of the test.
Parameters:
start - index to start search.
Returns:
index of the end of the test.

inMethod

public int inMethod(int start)
Search index of next entry of the method.
Parameters:
start - index to start search.
Returns:
index of next entry of the method.

outMethod

public int outMethod(int start)
Search index of next out of the method.
Parameters:
start - index to start search.
Returns:
index of next out of the method.

extractMethodCore

public java.lang.String extractMethodCore()
Extract the first method core found.
Returns:
the first method core found.

extractMethodCore

public java.lang.String extractMethodCore(int start)
Extract the first method core found.
Parameters:
start - Start index to search next method.
Returns:
the first method core found.

getParams

public java.lang.String[] getParams()
Extract params of a method call string.
Returns:
a string array where items are field.

getFields

public java.lang.String[] getFields()
Extract fields of 'C' structure string.
Returns:
a string array where items are field.

setComments

public java.lang.String setComments()
Convert the string to a javadoc or doc++ comment. It search the '\n' and add after it the sequence " * ". Note that the first '*' char is not set by this method.
Returns:
the string to a javadoc or doc++ comment.

insert

public void insert(int idx,
                   java.lang.String s)
Insert a new String in PogoString Object.
Parameters:
idx - Index where the string must be inserted.
s - String to be inserted.

replace

public void replace(java.lang.String pattern,
                    java.lang.String newOne)
             throws PogoException
replace the first pattern found by a new String.
Parameters:
pattern - Pattern String to be replaced.
newOne - New String to replace pattern.

replace

public void replace(int start,
                    java.lang.String pattern,
                    java.lang.String newOne)
             throws PogoException
replace the first pattern found by a new String.
Parameters:
start - Index to begin search of pattern.
pattern - Pattern String to be replaced.
newOne - New String to replace pattern.

append

public void append(java.lang.String newStr)
Append a new string at the end of this object.
Parameters:
newStr - the new string to be appened.

noEdges

public java.lang.String noEdges()
Returns:
the string used by this object whithout starting and ending space tab, or ',' char or comments tags. Like trim() in String class but extended.

noEdges

public java.lang.String noEdges(int start)
Parameters:
start - index to start the trim.
Returns:
the string used by this object whithout starting and ending space tab, or ',' char or comments tags. Like trim() in String class but extended.

getDescription

public java.lang.String getDescription()
extract the description text from comments.
Returns:
the text found.

extractClassFromPath

public java.lang.String extractClassFromPath()
Extract class name from a full path string.
Returns:
class name.

buildServerClassFromPath

public java.lang.String buildServerClassFromPath()
Build server class file name from a full path string.
Returns:
server class file name.

buildDescClassFromPath

public java.lang.String buildDescClassFromPath(int lang)
Build class description file name from a full path string. It depends on language.
Parameters:
lang - language to be interpreted.
Returns:
class description file name.

extractPathFromFullPath

public java.lang.String extractPathFromFullPath()
Build class description file name from a full path string. It depends on language.
Parameters:
lang - language to be interpreted.
Returns:
class description file name.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
the string used by this object

POGO Java Program