Top Description Constructors Methods
com.ongres.scram.common.util

public Class StringWritableCsv

extends Object
Class Inheritance
Imports
java.util.Arrays

Helper class to generate Comma Separated Values of StringWritables

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String[]

Returns:

An array of Strings which represent the individual attribute-values
parseFrom
(String
The String with the set of attribute-values
value
,
int
Number of entries to return (entries will be null of there were not enough). 0 means unlimited
n
,
int
How many entries to skip before start returning
offset
)

Parse a String with a StringWritableCsv into its composing Strings represented as Strings.

public static String[]

Returns:

An array of Strings which represent the individual attribute-values
parseFrom
(String
The String with the set of attribute-values
value
,
int
Number of entries to return (entries will be null of there were not enough). 0 means unlimited
n
)

Parse a String with a StringWritableCsv into its composing Strings represented as Strings.

public static String[]

Returns:

An array of Strings which represent the individual attribute-values
parseFrom
(String
The String with the set of attribute-values
value
)

Parse a String with a StringWritableCsv into its composing Strings represented as Strings.

private static void
public static StringBuffer

Returns:

The same sb, with data filled in (if any)
writeTo
(StringBuffer
The sb to write to
sb
,
StringWritable...
Zero or more attribute-value pairs to write
values
)

Write a sequence of StringWritableCsvs to a StringBuffer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StringWritableCsvback to summary
public StringWritableCsv()

Method Detail

parseFromback to summary
public static String[] parseFrom(String value, int n, int offset) throws IllegalArgumentException

Parse a String with a StringWritableCsv into its composing Strings represented as Strings. No validation is performed on the individual attribute-values returned.

Parameters
value:String

The String with the set of attribute-values

n:int

Number of entries to return (entries will be null of there were not enough). 0 means unlimited

offset:int

How many entries to skip before start returning

Returns:String[]

An array of Strings which represent the individual attribute-values

Exceptions
IllegalArgumentException:
If value is null or either n or offset are negative
parseFromback to summary
public static String[] parseFrom(String value, int n) throws IllegalArgumentException

Parse a String with a StringWritableCsv into its composing Strings represented as Strings. No validation is performed on the individual attribute-values returned. Elements are returned starting from the first available attribute-value.

Parameters
value:String

The String with the set of attribute-values

n:int

Number of entries to return (entries will be null of there were not enough). 0 means unlimited

Returns:String[]

An array of Strings which represent the individual attribute-values

Exceptions
IllegalArgumentException:
If value is null or n is negative
parseFromback to summary
public static String[] parseFrom(String value) throws IllegalArgumentException

Parse a String with a StringWritableCsv into its composing Strings represented as Strings. No validation is performed on the individual attribute-values returned. All the available attribute-values will be returned.

Parameters
value:String

The String with the set of attribute-values

Returns:String[]

An array of Strings which represent the individual attribute-values

Exceptions
IllegalArgumentException:
If value is null
writeStringWritableToStringBufferback to summary
private static void writeStringWritableToStringBuffer(StringWritable value, StringBuffer sb)
writeToback to summary
public static StringBuffer writeTo(StringBuffer sb, StringWritable... values) throws IllegalArgumentException

Write a sequence of StringWritableCsvs to a StringBuffer. Null StringWritables are not printed, but separator is still used. Separator is a comma (',')

Parameters
sb:StringBuffer

The sb to write to

values:StringWritable[]

Zero or more attribute-value pairs to write

Returns:StringBuffer

The same sb, with data filled in (if any)

Exceptions
IllegalArgumentException:
If sb is null