Quadcap Embeddable Server

com.quadcap.util.OctetComparator Class Reference

Inheritance diagram for com.quadcap.util.OctetComparator:

Comparator List of all members.

Detailed Description

This class implements a comparator for octet strings.

Author:
Stan Bailes

Definition at line 48 of file OctetComparator.java.

Public Member Functions

 OctetComparator ()
 Construct a new octet comparator.

 OctetComparator (boolean casemap, boolean reverse)
int compare (Object a, Object b)
 Ordering: is object 'a' less, equal, or greater than object 'b'?

boolean prefixMatch (OctetString obj, OctetString val)
 Determine if the search value is a prefix of the object being searched.

boolean substringMatch (OctetString obj, OctetString val)
 Determine if the search value is a substring of the object being searched.

boolean patternMatch (OctetString obj, OctetString pattern)
 Determine if the search value matches a glob-style pattern.


Package Functions

boolean pMatch (byte[] va, int a, byte[] vb, int b)
int pMatchOrder (byte[] va, int a, byte[] vb, int b)
byte[] getBytes (OctetString obj)
 The layer above which "i;octet" and "i;ascii-casemap" are the same comparator.


Package Attributes

boolean reverse = false
boolean casemap = false

Static Package Attributes

OctetComparator cmp = new OctetComparator()
OctetComparator casecmp = new OctetComparator(true,false)


Constructor & Destructor Documentation

com.quadcap.util.OctetComparator.OctetComparator  ) 
 

Construct a new octet comparator.

Definition at line 57 of file OctetComparator.java.

com.quadcap.util.OctetComparator.OctetComparator boolean  casemap,
boolean  reverse
 

Definition at line 59 of file OctetComparator.java.


Member Function Documentation

int com.quadcap.util.OctetComparator.compare Object  a,
Object  b
 

Ordering: is object 'a' less, equal, or greater than object 'b'?

(From the ACAP draft: draft-ietf-acap-spec-06.txt)

Ordering comparators can determine the ordinal precedence of any two values. When used for ordering, a comparator's name can be prefixed with "+" or "-" to indicate that the ordering should be normal order or reversed order respectively. If no prefix is included, "+" is assumed.

A comparator may designate certain values as having an undefined ordinal precedence. Such values collate with equal value after all other values regardless of whether normal or reverse ordering is used.

Parameters:
a the first object to compare
b the second object
Returns:
if a < b return -1 else if a > b return 1 else return 0

Definition at line 84 of file OctetComparator.java.

References com.quadcap.util.OctetComparator.compare(), com.quadcap.util.OctetComparator.getBytes(), and com.quadcap.util.OctetComparator.reverse.

Referenced by com.quadcap.util.OctetComparator.compare().

byte [] com.quadcap.util.OctetComparator.getBytes OctetString  obj  )  [package]
 

The layer above which "i;octet" and "i;ascii-casemap" are the same comparator.

Parameters:
obj the object whose bytes we want.

Definition at line 226 of file OctetComparator.java.

References com.quadcap.util.OctetComparator.casemap, com.quadcap.util.OctetString.getBytes(), and com.quadcap.util.OctetComparator.getBytes().

Referenced by com.quadcap.util.OctetComparator.compare(), com.quadcap.util.OctetComparator.getBytes(), com.quadcap.util.OctetComparator.patternMatch(), com.quadcap.util.OctetComparator.prefixMatch(), and com.quadcap.util.OctetComparator.substringMatch().

boolean com.quadcap.util.OctetComparator.patternMatch OctetString  obj,
OctetString  pattern
 

Determine if the search value matches a glob-style pattern.

Parameters:
obj the object to compare.
pattern the pattern
Returns:
true if obj matches the pattern specified by pattern.

Definition at line 161 of file OctetComparator.java.

References com.quadcap.util.OctetComparator.getBytes(), com.quadcap.util.OctetComparator.patternMatch(), and com.quadcap.util.OctetComparator.pMatch().

Referenced by com.quadcap.util.Config.getMatchingProps(), com.quadcap.util.Config.getPropSubset(), and com.quadcap.util.OctetComparator.patternMatch().

boolean com.quadcap.util.OctetComparator.pMatch byte[]  va,
int  a,
byte[]  vb,
int  b
[package]
 

Definition at line 167 of file OctetComparator.java.

References com.quadcap.util.OctetComparator.pMatch().

Referenced by com.quadcap.util.OctetComparator.patternMatch(), and com.quadcap.util.OctetComparator.pMatch().

int com.quadcap.util.OctetComparator.pMatchOrder byte[]  va,
int  a,
byte[]  vb,
int  b
[package]
 

Definition at line 192 of file OctetComparator.java.

References com.quadcap.util.OctetComparator.pMatchOrder().

Referenced by com.quadcap.util.OctetComparator.pMatchOrder().

boolean com.quadcap.util.OctetComparator.prefixMatch OctetString  obj,
OctetString  val
 

Determine if the search value is a prefix of the object being searched.

In the case of a prefix search on a multi-value, the match is successful if the value is a prefix of any one of the muliple values.

Parameters:
obj the "first" object to compare, normally the candidate object in a SEARCH operation.
val the "second" object, normally the constant value specified in the SEARCH operation.
Returns:
true if val is a prefix of obj.

Definition at line 116 of file OctetComparator.java.

References com.quadcap.util.OctetComparator.getBytes(), and com.quadcap.util.OctetComparator.prefixMatch().

Referenced by com.quadcap.util.OctetComparator.prefixMatch().

boolean com.quadcap.util.OctetComparator.substringMatch OctetString  obj,
OctetString  val
 

Determine if the search value is a substring of the object being searched.

In the case of a substring search on a multi-value, the match is successful if the value is a substring of any one of the muliple values.

Parameters:
obj the "first" object to compare, normally the candidate object in a SEARCH operation.
val the "second" object, normally the constant value specified in the SEARCH operation.
Returns:
true if val is a substring of obj.

Definition at line 138 of file OctetComparator.java.

References com.quadcap.util.OctetComparator.getBytes(), and com.quadcap.util.OctetComparator.substringMatch().

Referenced by com.quadcap.util.OctetComparator.substringMatch().


Member Data Documentation

OctetComparator com.quadcap.util.OctetComparator.casecmp = new OctetComparator(true,false) [static, package]
 

Definition at line 53 of file OctetComparator.java.

boolean com.quadcap.util.OctetComparator.casemap = false [package]
 

Definition at line 50 of file OctetComparator.java.

Referenced by com.quadcap.util.OctetComparator.getBytes().

OctetComparator com.quadcap.util.OctetComparator.cmp = new OctetComparator() [static, package]
 

Definition at line 52 of file OctetComparator.java.

boolean com.quadcap.util.OctetComparator.reverse = false [package]
 

Definition at line 49 of file OctetComparator.java.

Referenced by com.quadcap.util.OctetComparator.compare().