~ubuntu-branches/ubuntu/oneiric/tuxguitar/oneiric

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/song/models/TGLyric.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2008-06-19 00:30:30 UTC
  • mto: (5.1.2 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20080619003030-h719szrhsngou7c6
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.herac.tuxguitar.song.models;
 
2
 
 
3
public abstract class TGLyric {
 
4
        private static final String REGEX = " ";
 
5
        
 
6
        private int from;
 
7
        private String lyrics;
 
8
        
 
9
        public TGLyric(){
 
10
                this.from = 1;
 
11
                this.lyrics = new String();
 
12
        }
 
13
        
 
14
        public int getFrom() {
 
15
                return this.from;
 
16
        }
 
17
        
 
18
        public void setFrom(int from) {
 
19
                this.from = from;
 
20
        }
 
21
        
 
22
        public String getLyrics() {
 
23
                return this.lyrics;
 
24
        }
 
25
        
 
26
        public void setLyrics(String lyrics) {
 
27
                this.lyrics = lyrics;
 
28
        }
 
29
        
 
30
        public String[] getLyricBeats(){
 
31
                String lyrics = getLyrics();
 
32
                lyrics = lyrics.replaceAll("\n",REGEX);
 
33
                lyrics = lyrics.replaceAll("\r",REGEX);
 
34
                return lyrics.split(REGEX);
 
35
        }
 
36
        
 
37
        public boolean isEmpty(){
 
38
                return (getLyrics().length() == 0);
 
39
        }
 
40
        
 
41
        public void copy(TGLyric lyric){
 
42
                lyric.setFrom(getFrom());
 
43
                lyric.setLyrics(getLyrics());
 
44
        }
 
45
        
 
46
}