Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / site_perl / 5.8.0 / Pastel / AttributeSet.pm
CommitLineData
86530b38
AT
1# Perl module for AttributeSet
2# Author: Malay < curiouser@ccmb.res.in>
3# Copyright Malay
4# You may distribute this module under the same terms as perl itself
5
6# POD documentation - main docs before the code
7
8=head1 NAME
9
10AttributeSet - Collection of attributes.
11
12=head1 SYNOPSIS
13
14 $as = Pastel::AttributeSet->new();
15 $fill_color = Pastel::Color->red();
16 my $att = Pastel::Attribute->new(-type=>"FILL", -object=>$fill_color);
17 $as->add_attribute($att);
18 # Iterate through AttributeSet
19 while ( $as->has_more() ){
20 $attribute = $as->get_attribute();
21 print $attribute->to_svg();
22 }
23
24 # or get the full thing as SVG
25 my $svg = $as->to_svg();
26
27=head1 DESCRIPTION
28
29AttributeSet is a collection of Attribute objects.
30
31=head1 CONTACT
32
33Malay <curiouser@ccmb.res.in>
34
35=cut
36
37# Let the code begin...
38
39package Pastel::AttributeSet;
40@ISA = qw (Pastel::Root);
41use Pastel::Root;
42use strict;
43
44=head1 CONSTRUCTOR
45
46=head2 new()
47
48Returns an empty AttributeSet object.
49
50=cut
51
52# _init is where the heavy stuff will happen when new is called
53
54sub _init {
55 my ( $self, @args ) = @_;
56 $self->{attributes} = [];
57 return $self;
58}
59
60=head2 add_attribute()
61
62 Usage:
63 Function:
64 Example:
65 Returns:
66 Arguments
67
68=cut
69
70sub add_attribute {
71 my ( $self, $att ) = @_;
72 push ( @{ $self->{attributes} }, $att );
73}
74
75=head1 APPENDIX
76
77
78
79=cut
80
811;