CSS::SAC::Condition::Negative - SAC NegativeConditions


CSS-SAC documentation Contained in the CSS-SAC distribution.

Index


Code Index:

NAME

Top

CSS::SAC::Condition::Negative - SAC NegativeConditions

SYNOPSIS

Top

 see CSS::SAC::Condition

DESCRIPTION

Top

This is a subclass of CSS::SAC::Condition, look there for more documentation. This class adds the following methods (the spec equivalents are available as well, just prepend 'get'):

METHODS

Top

* CSS::SAC::Condition::Negative->new($type,$cond)
* $cond->new($type,$cond)

Creates a new negative condition.

* $ccond->Condition([$cond])

get/set the condition's sub condition

AUTHOR

Top

Robin Berjon <robin@knowscape.com>

This module is licensed under the same terms as Perl itself.


CSS-SAC documentation Contained in the CSS-SAC distribution.

###
# CSS::SAC::Condition::Negative - SAC NegativeConditions
# Robin Berjon <robin@knowscape.com>
# 24/02/2001
###

package CSS::SAC::Condition::Negative;
use strict;
use vars qw($VERSION);
$VERSION = $CSS::SAC::VERSION || '0.03';

use base qw(CSS::SAC::Condition);


#---------------------------------------------------------------------#
# build the fields for an array based object
#---------------------------------------------------------------------#
use Class::ArrayObjects extend => {
                                   class => 'CSS::SAC::Condition',
                                   with  => [qw(
                                                _cond_
                                              )],
                                  };
#---------------------------------------------------------------------#




### Constructor #######################################################
#                                                                     #
#                                                                     #


#---------------------------------------------------------------------#
# CSS::SAC::Condition::Negative->new($type,$cond)
# creates a new sac NegativeCondition object
#---------------------------------------------------------------------#
sub new {
    my $class = ref($_[0])?ref(shift):shift;
    my $type = shift; # should be one of the content conditions
    my $cond = shift;

    # create a condition
    my $ncond = $class->SUPER::new($type);

    # add our fields
    $ncond->[_cond_] = $cond;

    return $ncond;
}
#---------------------------------------------------------------------#


#                                                                     #
#                                                                     #
### Constructor #######################################################



### Accessors #########################################################
#                                                                     #
#                                                                     #

# aliases
*CSS::SAC::Condition::Negative::getCondition = \&Condition;


#---------------------------------------------------------------------#
# my $cond = $ncond->Condition()
# $ncond->Condition($cond)
# get/set the condition's sub condition
#---------------------------------------------------------------------#
sub Condition {
    (@_==2) ? $_[0]->[_cond_] = $_[1] :
              $_[0]->[_cond_];
}
#---------------------------------------------------------------------#


#                                                                     #
#                                                                     #
### Accessors #########################################################



1;