5ba70a546ffb7f824f6dc40832bf9cf693f3eea8
[hespiff.git] / src / main / java / org / hedgecode / xml / xspf / XMLBindTrack.java
1 /*
2  * Copyright (c) 2015. Developed by Hedgecode.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *   http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.hedgecode.xml.xspf;
18
19 import java.util.List;
20
21 import org.hedgecode.xml.xspf.bind.Binder;
22 import org.hedgecode.xml.xspf.bind.BinderFactory;
23 import org.hedgecode.xml.xspf.bind.TrackBinder;
24
25 import static org.hedgecode.xml.xspf.XSPFConstants.Format;
26
27 /**
28  *
29  *
30  * @author Dmitry Samoshin aka gotty
31  */
32 public class XMLBindTrack extends AbstractXMLBindElement implements Track {
33
34     private TrackBinder binder;
35
36     protected XMLBindTrack(TrackBinder binder) {
37         if (binder == null)
38             this.binder = BinderFactory.createTrackBinder();
39         else
40             this.binder = binder;
41     }
42
43     protected XMLBindTrack(Format format) {
44         this.binder = BinderFactory.createTrackBinder(format);
45     }
46
47     @Override
48     protected Binder getBinder() {
49         return binder;
50     }
51
52     @Override
53     public List<String> getLocations() {
54         return binder.getLocations();
55     }
56
57     @Override
58     public void addLocation(String location) {
59         binder.addLocation(location);
60     }
61
62     @Override
63     public List<String> getIdentifiers() {
64         return binder.getIdentifiers();
65     }
66
67     @Override
68     public void addIdentifier(String identifier) {
69         binder.addIdentifier(identifier);
70     }
71
72     @Override
73     public String getAlbum() {
74         return binder.getAlbum();
75     }
76
77     @Override
78     public void setAlbum(String album) {
79         binder.setAlbum(album);
80     }
81
82     @Override
83     public Integer getTrackNum() {
84         return binder.getTrackNum();
85     }
86
87     @Override
88     public void setTrackNum(Integer trackNum) {
89         binder.setTrackNum(trackNum);
90     }
91
92     @Override
93     public Integer getDuration() {
94         return binder.getDuration();
95     }
96
97     @Override
98     public void setDuration(Integer duration) {
99         binder.setDuration(duration);
100     }
101
102 }