org.sblim.slp.internal

Class SLPString


public class SLPString
extends java.lang.Object

 This class provides functions for comparision of SLP message strings.
 
 From RFC 2608:
 
 String comparison for order and equality in SLP MUST be case
 insensitive inside the 0x00-0x7F subrange of UTF-8 (which corresponds
 to ASCII character encoding).  Case insensitivity SHOULD be supported
 throughout the entire UTF-8 encoded Unicode [6] character set.

 The case insensitivity rule applies to all string matching in SLPv2,
 including Scope strings, SLP SPI strings, service types, attribute
 tags and values in query handling, language tags, previous responder
 lists.  Comparisons of URL strings, however, is case sensitive.

 White space (SPACE, CR, LF, TAB) internal to a string value is folded
 to a single SPACE character for the sake of string comparisons.
 White space preceding or following a string value is ignored for the
 purposes of string comparison.  For example, "  Some String  "
 matches "SOME    STRING".
 

Method Summary

static int
compare(String pStr0, String pStr1)
compare
static boolean
equals(String pStr0, String pStr1)
equals
static String
unify(String pStr)
public for testing only.

Method Details

compare

public static int compare(String pStr0,
                          String pStr1)
compare
Parameters:
pStr0 -
pStr1 -
Returns:
int

equals

public static boolean equals(String pStr0,
                             String pStr1)
equals
Parameters:
pStr0 -
pStr1 -
Returns:
boolean

unify

public static String unify(String pStr)
public for testing only.
Parameters:
pStr -
Returns:
String

Copyright © 2005, 2009 IBM Corporation. All Rights Reserved.