| RDF-Trine documentation | Contained in the RDF-Trine distribution. |
RDF::Trine::Node::Nil - RDF Node class for the nil node
This document describes RDF::Trine::Node::Nil version 0.135
Beyond the methods documented below, this class inherits methods from the RDF::Trine::Node class.
new ()Returns the nil-valued node.
is_nilReturns true if this object is the nil-valued node.
sseReturns the SSE string for this nil node.
typeReturns the type string of this node.
valueReturns the empty string.
equal ( $node )Returns true if the two nodes are equal, false otherwise.
Gregory Todd Williams <gwilliams@cpan.org>
Copyright (c) 2006-2010 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| RDF-Trine documentation | Contained in the RDF-Trine distribution. |
# RDF::Trine::Node::Nil # -----------------------------------------------------------------------------
package RDF::Trine::Node::Nil; use strict; use warnings; no warnings 'redefine'; use base qw(RDF::Trine::Node); use Data::Dumper; use Scalar::Util qw(blessed refaddr); use Carp qw(carp croak confess); ###################################################################### my $NIL_NODE; our ($VERSION); BEGIN { $VERSION = '0.135'; } ###################################################################### use overload '""' => sub { $_[0]->sse }, ;
sub new { my $class = shift; if (blessed($NIL_NODE)) { return $NIL_NODE; } else { $NIL_NODE = bless({}, $class); return $NIL_NODE; } }
sub is_nil { my $self = shift; return (refaddr($self) == refaddr($NIL_NODE)); }
sub sse { my $self = shift; return '(nil)'; }
sub type { return 'NIL'; }
sub value { my $self = shift; return ''; }
sub equal { my $self = shift; my $node = shift; return 0 unless (blessed($node)); if ($self->isa('RDF::Trine::Node::Nil') and $node->isa('RDF::Trine::Node::Nil')) { return 1; } else { return 0; } } # called to compare two nodes of the same type sub _compare { return 0; } 1; __END__