Data::Sofu::Undefined - A Sofu non type
Provides a interface similar to the original SofuD (sofu.sf.net)
This Object is similar to Perl's undef .
It is nothing (not even a Data::Sofu::Value
) but it is still there (in Lists or Maps for example)
require Data::Sofu::Undefined; require Data::Sofu::Map; my $u = Data::Sofu::Undefined->new(); my $map = Data::Sofu::Map->new(); $map->setAttribute("Nx",$u); $map->hasMap("Nx"); # Returns 0 $map->hasValue("Nx"); # Returns 0 $map->hasAttribute("Nx"); # Returns 1 # It is also there in $map->each() and $map->next();
This Module is pure OO, exports nothing
Also look at Data::Sofu::Object
for methods, cause Undefined inherits from it
new()
Creates a new Data::Sofu::Undefined
and returns it
$val = Data::Sofu::Undefined->new();
isDefined()
Returns false
stringify(LEVEL, TREE)
Returns the string representation of this Object.
Which is the string "UNDEF"
LEVEL and TREE are ignored.
binarify(TREE, BDRIVER)
Returns a binary representation of this Object. Don't call this (will be called from packBinary()
and writeBinary())
This still tests true when using:
my $u=Data::Sofu::Undefined->new(); if ($u) { #This will happen. } if ($u->isDefined()) { #This will not happen. }
the Data::Sofu manpage, the Data::Sofu::Value manpage, the Data::Sofu::Object manpage, the Data::Sofu::Map manpage, the Data::Sofu::Value manpage, the Data::Sofu::Reference manpage, http://sofu.sf.net