All Packages Class Hierarchy This Package Previous Next Index
Class ORG.opengroup.misc.Line
java.lang.Object
|
+----ORG.opengroup.misc.Line
- public class Line
- extends Object
- implements Enumeration
A structure tp process a multi-line string
Line(String)
- Analyze a multi-line string.
getHeight()
- Returns the number of lines in the string.
getWidth()
- Returns the number of characters in the longest line.
hasMoreElements()
- Returns true if there is another line.
nextElement()
- Returns the next line.
Line
public Line(String multi)
- Analyze a multi-line string. Carrage returns are ignored;
only line feeds ('\n') are significant.
- Parameters:
- multi - The multi-line string or null.
getHeight
public int getHeight()
- Returns the number of lines in the string.
Returns 0 only if null was passed to the constructor.
Returns 1 only if there were no line feeds passed to the constructor.
getWidth
public int getWidth()
- Returns the number of characters in the longest line.
hasMoreElements
public boolean hasMoreElements()
- Returns true if there is another line.
nextElement
public Object nextElement()
- Returns the next line. (Cast to String.)
If there are no more lines, null is returned.
All Packages Class Hierarchy This Package Previous Next Index