TinyLine
v2.0

com.tinyline.svg
Class SVGAttr

java.lang.Object
  extended bycom.tinyline.svg.SVGAttr

public class SVGAttr
extends java.lang.Object

The SVGAttr class implements the SVGT attributes parser.

Version:
1.10

Author:
Andrew Girow

Constructor Summary
SVGAttr()
          Constructs a new SVGAttr object.
SVGAttr(int width, int height)
          Constructs a new SVGAttr object.
 
Method Summary
 java.lang.Object attributeValue(int helem, int hattr, char[] buf, int offset, int len)
          Parses the SVG attribute value for the given element and attribute.
static boolean endsWith(TinyString str, TinyString s)
          Tests if this string ends with the specified suffix.
static boolean startsWith(TinyString str, TinyString s, int i)
          Tests if this string starts with the specified prefix beginning a specified index.
static TinyString substring(TinyString str, int beginIndex)
          Returns a new string that is a substring of this string.
static TinyString substring(TinyString str, int beginIndex, int endIndex)
          Returns a new string that is a substring of this string.
static TinyString trim(TinyString str)
          Returns a copy of the string, with leading and trailing whitespace omitted.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVGAttr

public SVGAttr()
Constructs a new SVGAttr object.


SVGAttr

public SVGAttr(int width,
               int height)
Constructs a new SVGAttr object.

Method Detail

attributeValue

public java.lang.Object attributeValue(int helem,
                                       int hattr,
                                       char[] buf,
                                       int offset,
                                       int len)
Parses the SVG attribute value for the given element and attribute.

Parameters:
helem - The SVG element handle.
hattr - The SVG attribute handle.
buf - The input buffer.
offset - The input buffer pointer.
len - The input buffer length.
Returns:
The SVG attribute value or null.

startsWith

public static boolean startsWith(TinyString str,
                                 TinyString s,
                                 int i)
Tests if this string starts with the specified prefix beginning a specified index.

Parameters:
s - the prefix.
i - where to begin looking in the string.
Returns:
true if the character sequence represented by the argument is a prefix of the substring of this object starting at index i; false otherwise.

endsWith

public static boolean endsWith(TinyString str,
                               TinyString s)
Tests if this string ends with the specified suffix.

Parameters:
s - the suffix.
Returns:
true if the character sequence represented by the argument is a suffix of the character sequence represented by this object; false otherwise.

trim

public static TinyString trim(TinyString str)
Returns a copy of the string, with leading and trailing whitespace omitted.

Returns:
A copy of this string with leading and trailing white space removed, or this string if it has no leading or trailing white space.

substring

public static TinyString substring(TinyString str,
                                   int beginIndex)
Returns a new string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string.

Parameters:
beginIndex - the beginning index, inclusive.
Returns:
the specified substring or null.

substring

public static TinyString substring(TinyString str,
                                   int beginIndex,
                                   int endIndex)
Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex.

Parameters:
beginIndex - the beginning index, inclusive.
endIndex - the ending index, exclusive.
Returns:
the specified substring or null.

TinyLine
v2.0

Provided under the terms of the TinyLine License Agreement that has been included with this distribution