summaryrefslogtreecommitdiff
path: root/fml/lib/IO/Adapter/Array.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-06-30 03:05:13 +0000
committerfukachan <fukachan>2004-06-30 03:05:13 +0000
commitb82e1fde5ecb5a7cf008ebcedc5268ac1a7aac72 (patch)
tree91962526ea9859c847ceeee3890b0c1389c1b1d8 /fml/lib/IO/Adapter/Array.pm
parent8bd1d2a1110bb0a6e55daf3b397e34ae3f47ea72 (diff)
downloadfml8-b82e1fde5ecb5a7cf008ebcedc5268ac1a7aac72.tar.gz
fml8-b82e1fde5ecb5a7cf008ebcedc5268ac1a7aac72.tar.bz2
fml8-b82e1fde5ecb5a7cf008ebcedc5268ac1a7aac72.zip
overhaul: fix comments and messages. validate initial value.
Diffstat (limited to 'fml/lib/IO/Adapter/Array.pm')
-rw-r--r--fml/lib/IO/Adapter/Array.pm16
1 files changed, 10 insertions, 6 deletions
diff --git a/fml/lib/IO/Adapter/Array.pm b/fml/lib/IO/Adapter/Array.pm
index 7b8b3779..014439d1 100644
--- a/fml/lib/IO/Adapter/Array.pm
+++ b/fml/lib/IO/Adapter/Array.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Array.pm,v 1.34 2003/11/29 06:31:48 fukachan Exp $
+# $FML: Array.pm,v 1.35 2004/01/24 09:03:55 fukachan Exp $
#
package IO::Adapter::Array;
@@ -84,7 +84,7 @@ $flag is "r" only (read only) now.
# flag => $flag
# _array_reference => ARRAY_REFERENCE
# }
-# Side Effects: malloc @elements array
+# Side Effects: malloc @elements array.
# Return Value: ARRAY_REF
sub open
{
@@ -102,7 +102,7 @@ sub open
$self->{_elements} = $r_array;
$self->{_num_elements} = $#elements;
$self->{_counter} = 0;
- return( @elements ? \@elements : undef );
+ return( @elements ? \@elements : [] );
}
@@ -119,7 +119,7 @@ return the next element of the array.
=cut
-# Descriptions: forwarded to get_next_key()
+# Descriptions: forwarded to get_next_key().
# XXX getline() == get_next_key() is valid in this case.
# XXX since this map has only key and no value.
# Arguments: OBJ($self) HASH_REF($args)
@@ -128,7 +128,8 @@ return the next element of the array.
sub getline { get_next_key(@_);}
-# Descriptions: return (key, values, ... ) as ARRAY_REF
+# Descriptions: return (key, values, ... ) as ARRAY_REF.
+# XXX no value in the case of this map.
# Arguments: OBJ($self) HASH_REF($args)
# Side Effects: none
# Return Value: ARRAY_REF
@@ -139,7 +140,7 @@ sub get_key_values_as_array_ref
return [ $x ];
}
-# Descriptions: return the next element of the array
+# Descriptions: return the next element of the array.
# Arguments: OBJ($self) HASH_REF($args)
# Side Effects: increment the counter in the object
# Return Value: STR(the next element)
@@ -198,6 +199,7 @@ end of IO operation. It is a dummy.
=cut
+
# Descriptions: echeck whether end of the array is not now.
# Arguments: OJB($self)
# Side Effects: none
@@ -206,6 +208,8 @@ end of IO operation. It is a dummy.
sub eof
{
my ($self) = @_;
+
+ # XXX-TODO: > ? >= ? OK?
$self->{_counter} > $self->{_num_elements} ? 1 : 0;
}