Source code: com/virtuosotechnologies/asaph/standardmodel/StdAddedSongBlock.java
1 /*
2 ================================================================================
3
4 FILE: StdAddedSongBlock.java
5
6 PROJECT:
7
8 Asaph
9
10 CONTENTS:
11
12 Standard implementation of AddedSongBlock
13
14 PROGRAMMERS:
15
16 Daniel Azuma (DA) <dazuma@kagi.com>
17
18 COPYRIGHT:
19
20 Copyright (C) 2003 Daniel Azuma (dazuma@kagi.com)
21
22 This program is free software; you can redistribute it and/or
23 modify it under the terms of the GNU General Public License as
24 published by the Free Software Foundation; either version 2
25 of the License, or (at your option) any later version.
26
27 This program is distributed in the hope that it will be useful,
28 but WITHOUT ANY WARRANTY; without even the implied warranty of
29 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 GNU General Public License for more details.
31
32 You should have received a copy of the GNU General Public
33 License along with this program; if not, write to
34 Free Software Foundation, Inc.
35 59 Temple Place, Suite 330
36 Boston, MA 02111-1307 USA
37
38 ================================================================================
39 */
40
41
42 package com.virtuosotechnologies.asaph.standardmodel;
43
44
45 import java.io.IOException;
46
47 import com.virtuosotechnologies.lib.util.StringID;
48 import com.virtuosotechnologies.lib.xml.XMLUnparser;
49
50 import com.virtuosotechnologies.asaph.model.AddedSongBlock;
51 import com.virtuosotechnologies.asaph.model.Variation;
52
53
54 /**
55 * Standard implementation of AddedSongBlock
56 */
57 /*package*/ class StdAddedSongBlock
58 extends BaseSongBlock
59 implements
60 AddedSongBlock
61 {
62 private StdVariation addingVariation_;
63
64
65 /**
66 * Constructor
67 */
68 /*package*/ StdAddedSongBlock(
69 StdSong parent,
70 StdVariation addingVariation,
71 StringID id)
72 {
73 this(parent, addingVariation, id, 0);
74 }
75
76
77 /**
78 * Constructor
79 */
80 /*package*/ StdAddedSongBlock(
81 StdSong parent,
82 StdVariation addingVariation,
83 StringID id,
84 int indentLevel)
85 {
86 super(parent, id, indentLevel);
87 addingVariation_ = addingVariation;
88 }
89
90
91 /*package*/ void unparseVariationAttribute(
92 XMLUnparser unparser)
93 throws
94 IOException
95 {
96 unparser.addAttribute(XMLConstants.BLOCK_ADDVARIATION_ATTRIBUTE,
97 addingVariation_.getSerializableID());
98 }
99
100
101 //-------------------------------------------------------------------------
102 // Methods of AddedSongBlock
103 //-------------------------------------------------------------------------
104
105 /**
106 * Get the Variation in which this block is added.
107 *
108 * @return Variation
109 */
110 public Variation getAddingVariation()
111 {
112 return addingVariation_;
113 }
114 }