com.sas.util.transforms
Class StaticCollectionInterfaceToStringTransform

com.sas.util.transforms.StaticCollectionInterfaceToStringTransform
All Implemented Interfaces:
com.sas.util.transforms.TransformInterface, java.io.Serializable
Direct Known Subclasses:
StaticOrderedCollectionInterfaceToStringTransform

public class StaticCollectionInterfaceToStringTransform
implements com.sas.util.transforms.TransformInterface

A transform for converting a StaticCollectionInterface to a String. For example, a given a collection that contains the values

    "com.sas"
    null
    "webAF"
    1
 
then invoking this transorm on the collection String s t.transform(collection) will yield the string "com.sas",null,"webAF",a.

See Also:
StringToCollectionInterfaceTransform, Serialized Form

Field Summary
static StaticCollectionInterfaceToStringTransform defaultInstance
          An object which can perform a default transform from CollectionInterface to String.
 
Constructor Summary
StaticCollectionInterfaceToStringTransform()
          Default constructor.
StaticCollectionInterfaceToStringTransform(char delimiter, boolean alwaysQuote)
          Value constructor.
 
Method Summary
protected static char defaultDelimiterChar()
           
 java.lang.Object transform(java.lang.Object object)
          Transform an object.
 

Field Detail

defaultInstance

public static final StaticCollectionInterfaceToStringTransform defaultInstance
An object which can perform a default transform from CollectionInterface to String.

Constructor Detail

StaticCollectionInterfaceToStringTransform

public StaticCollectionInterfaceToStringTransform()
Default constructor. Create a transform which converts a CollectionInterface into a String, using the default delimiter ',' and always quoting strings


StaticCollectionInterfaceToStringTransform

public StaticCollectionInterfaceToStringTransform(char delimiter,
                                                  boolean alwaysQuote)
Value constructor. Create a transform which converts a CollectionInterface into a String, using the specific delimiter and quoting.

Parameters:
delimiter - character to separate the string items in the result
alwaysQuote - if true, each string is quoted, else only special strings are quoted.
Method Detail

defaultDelimiterChar

protected static char defaultDelimiterChar()

transform

public java.lang.Object transform(java.lang.Object object)
Transform an object. This method transforms a CollectionInterface to a String.

Specified by:
transform in interface com.sas.util.transforms.TransformInterface
Parameters:
object - an input object. Must be null or an instance of CollectionInterface
Returns:
a string representation of the string list.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.