| CQL-Parser documentation | Contained in the CQL-Parser distribution. |
CQL::Relation - object for CQL Relations
CQL::Relation represents the common CQL relation operations ( =, >, <, any, all and exact. In addition modifiers may be applied (stem, relevant, fuzzy, phonetic). The operators are passed into the constructor as the base relation.
Creates a new CQL::Relation object with the specified base relation.
Returns the base relation with which the CQL::Relation object was originally created.
Adds a new relation modifier to the specified CQLRelation. Typical relation modifiers include relevant, fuzzy stem and phonetic. On the whole, these modifiers have a meaningful interpretation only for the text relations.
Returns a list of modifiers associated with a CQL relation.
| CQL-Parser documentation | Contained in the CQL-Parser distribution. |
package CQL::Relation; use strict; use warnings; use Class::Accessor; use CQL::ModifierSet; use base qw( CQL::Node );
sub new { my ($class,$base) = @_; my $ms = CQL::ModifierSet->new( $base ); return bless { modifierSet => $ms }, ref($class) || $class; }
sub getBase { return shift->{modifierSet}->getBase(); }
sub addModifier { my ($self,$modifier) = @_; $self->{modifierSet}->addModifier( undef, $modifier ); }
sub getModifiers { return shift->{modifierSet}->getModifiers(); }
sub toCQL { return shift->{modifierSet}->toCQL(); }
sub toSwish { return shift->{modifierSet}->toSwish(); }
sub toXCQL { my ($self,$level) = @_; my $xml = $self->{modifierSet}->toXCQL( $level, "relation" ); return $self->addNamespace( $level, $xml ); }
sub toLucene { return shift->{modifierSet}->toLucene(); } 1;