Skip to content

Commit 978d8d6

Browse files
committed
cleanup
1 parent 70314f8 commit 978d8d6

File tree

85 files changed

+813
-851
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+813
-851
lines changed

src/main/java/nl/digitalekabeltelevisie/controller/DVBString.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public String getEncodingString(){
145145
if(0x20<=fb)
146146
{
147147
return "default (ISO 6937, latin)";
148-
}else if((0x01<=fb)&&(fb<=0x1F)){
148+
}else if(0x01<=fb){
149149
switch (fb) {
150150
case 0x01:
151151
return "ISO/IEC 8859-5";

src/main/java/nl/digitalekabeltelevisie/data/mpeg/descriptors/AACDescriptor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class AACDescriptor extends Descriptor {
4444

4545
private byte[] additional_info;
4646

47-
public AACDescriptor(final byte[] b, final TableSection parent) {
47+
public AACDescriptor(byte[] b, TableSection parent) {
4848
super(b ,parent);
4949
profile_and_level = getInt(b, 2, 1, MASK_8BITS);
5050
if(descriptorLength > 1){
@@ -62,9 +62,9 @@ public AACDescriptor(final byte[] b, final TableSection parent) {
6262
}
6363

6464
@Override
65-
public KVP getJTreeNode(final int modus){
65+
public KVP getJTreeNode(int modus){
6666

67-
final KVP t = super.getJTreeNode(modus);
67+
KVP t = super.getJTreeNode(modus);
6868
t.add(new KVP("profile_and_level",profile_and_level,getProfileLevelString(profile_and_level)));
6969
if(descriptorLength > 1){
7070
t.add(new KVP("AAC_type_flag",aac_type_flag));

src/main/java/nl/digitalekabeltelevisie/data/mpeg/descriptors/AACMpeg2Descriptor.java

Lines changed: 26 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -51,63 +51,43 @@ public AACMpeg2Descriptor(byte[] b, TableSection parent) {
5151
@Override
5252
public KVP getJTreeNode(int modus){
5353

54-
final KVP t = super.getJTreeNode(modus);
54+
KVP t = super.getJTreeNode(modus);
5555
t.add(new KVP("MPEG-2_AAC_profile",mpeg2_aac_profile,getProfileString(mpeg2_aac_profile)));
5656
t.add(new KVP("MPEG-2_AAC_channel_configuration",mpeg2_aac_channel_configuration,getChannelConfigurationString(mpeg2_aac_channel_configuration)));
5757
t.add(new KVP("MPEG-2_AAC_additional_information",additional_info,getAdditionalInfoString(additional_info)));
5858

5959
return t;
6060
}
6161

62-
public static String getProfileString(final int profile) {
63-
switch (profile) {
64-
65-
case 0x00:
66-
return "Main profile";
67-
case 0x01:
68-
return "Low Complexity profile (LC)";
69-
case 0x02:
70-
return "Scalable Sampling Rate profile (SSR)";
71-
case 0x03:
72-
return "Reserved";
73-
default:
74-
return "Unknown";
75-
76-
}
62+
public static String getProfileString(int profile) {
63+
return switch (profile) {
64+
case 0x00 -> "Main profile";
65+
case 0x01 -> "Low Complexity profile (LC)";
66+
case 0x02 -> "Scalable Sampling Rate profile (SSR)";
67+
case 0x03 -> "Reserved";
68+
default -> "Unknown";
69+
};
7770
}
7871

7972
public static String getAdditionalInfoString(int code) {
80-
switch (code) {
81-
82-
case 0x00:
83-
return "AAC data according to ISO/IEC 13818-7:2003";
84-
case 0x01:
85-
return "AAC data with Bandwidth Extension data present according to ISO/IEC 13818-7:2003/AMD1:2004";
86-
default:
87-
return "Reserved";
88-
}
73+
return switch (code) {
74+
case 0x00 -> "AAC data according to ISO/IEC 13818-7:2003";
75+
case 0x01 -> "AAC data with Bandwidth Extension data present according to ISO/IEC 13818-7:2003/AMD1:2004";
76+
default -> "Reserved";
77+
};
8978
}
9079

91-
public static String getChannelConfigurationString(final int code) {
92-
switch (code) {
93-
94-
case 0x01:
95-
return "Mono (center front speaker)";
96-
case 0x02:
97-
return "Stereo (left, right front speakers)";
98-
case 0x03:
99-
return "3 speakers (center front speaker left, right front speakers)";
100-
case 0x04:
101-
return "4 speakers (center front speaker left, right center front speakers, rear surround)";
102-
case 0x05:
103-
return "5 speakers (center front speaker left, right front speakers, left surround, right surround rear speakers)";
104-
case 0x06:
105-
return "5.1";
106-
case 0x07:
107-
return "7.1";
108-
default:
109-
return "Unknown configuration";
110-
111-
}
80+
public static String getChannelConfigurationString(int code) {
81+
return switch (code) {
82+
case 0x01 -> "Mono (center front speaker)";
83+
case 0x02 -> "Stereo (left, right front speakers)";
84+
case 0x03 -> "3 speakers (center front speaker left, right front speakers)";
85+
case 0x04 -> "4 speakers (center front speaker left, right center front speakers, rear surround)";
86+
case 0x05 ->
87+
"5 speakers (center front speaker left, right front speakers, left surround, right surround rear speakers)";
88+
case 0x06 -> "5.1";
89+
case 0x07 -> "7.1";
90+
default -> "Unknown configuration";
91+
};
11292
}
11393
}

src/main/java/nl/digitalekabeltelevisie/data/mpeg/descriptors/AC3Descriptor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ public AC3Descriptor( byte[] b, TableSection parent) {
7575

7676

7777
@Override
78-
public KVP getJTreeNode(final int modus){
78+
public KVP getJTreeNode(int modus){
7979

80-
final KVP t = super.getJTreeNode(modus);
80+
KVP t = super.getJTreeNode(modus);
8181
t.add(new KVP("component_type_flag",component_type_flag));
8282
t.add(new KVP("bsid_flag",bsid_flag));
8383
t.add(new KVP("mainid_flag",mainid_flag));
@@ -103,8 +103,8 @@ public KVP getJTreeNode(final int modus){
103103
return t;
104104
}
105105

106-
public static String getComponentTypeString(final int type){
107-
final StringBuilder s = new StringBuilder();
106+
public static String getComponentTypeString(int type){
107+
StringBuilder s = new StringBuilder();
108108
if((type&0x80)==0x80){
109109
s.append("Enhanced AC-3, ");
110110
}else{

src/main/java/nl/digitalekabeltelevisie/data/mpeg/descriptors/AdaptationFieldDataDescriptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public String toString() {
4949

5050
@Override
5151
public KVP getJTreeNode(int modus){
52-
final KVP t = super.getJTreeNode(modus);
52+
KVP t = super.getJTreeNode(modus);
5353
t.add(new KVP("adaptation_field_data_identifier",adaptationFieldDataIdentifier ,getAdaptationFieldDataIdentifierString(adaptationFieldDataIdentifier)));
5454
return t;
5555
}

src/main/java/nl/digitalekabeltelevisie/data/mpeg/descriptors/ApplicationSignallingDescriptor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class ApplicationSignallingDescriptor extends Descriptor{
5151

5252
public record ApplicationType(int applicationType, int aitVersionNumber) implements TreeNode {
5353

54-
public KVP getJTreeNode(final int modus) {
54+
public KVP getJTreeNode(int modus) {
5555
KVP s = new KVP("AIT");
5656
s.add(new KVP("application_type", applicationType, getAppTypeIDString(applicationType)));
5757
s.add(new KVP("AIT_version_number", aitVersionNumber));
@@ -74,8 +74,8 @@ public ApplicationSignallingDescriptor(byte[] b, TableSection parent) {
7474
}
7575

7676
@Override
77-
public KVP getJTreeNode(final int modus){
78-
final KVP t = super.getJTreeNode(modus);
77+
public KVP getJTreeNode(int modus){
78+
KVP t = super.getJTreeNode(modus);
7979
addListJTree(t,applicationTypeList,modus,"Application Information Table");
8080

8181
return t;

src/main/java/nl/digitalekabeltelevisie/data/mpeg/descriptors/BouquetNameDescriptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public DVBString getBouquetName() {
4949

5050
@Override
5151
public String toString() {
52-
return super.toString() + "bouquetName="+getBouquetName().toString();
52+
return super.toString() + "bouquetName="+ bouquetName.toString();
5353
}
5454

5555
@Override

src/main/java/nl/digitalekabeltelevisie/data/mpeg/descriptors/CableDeliverySystemDescriptor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ public int getFEC_outer() {
6161
}
6262

6363
public String getFEC_outerString() {
64-
return switch (getFEC_outer()) {
64+
return switch (FEC_outer) {
6565
case 0 -> "not defined";
6666
case 1 -> "no outer FEC coding";
6767
case 2 -> "RS(204/188)";
6868
default -> "reserved for future use";
6969
};
7070
}
7171

72-
public static String getModulationString(final int mod) {
72+
public static String getModulationString(int mod) {
7373
return switch (mod) {
7474
case 0x00 -> "not defined";
7575
case 0x01 -> "16-QAM";
@@ -97,7 +97,7 @@ public String getSymbol_rate() {
9797

9898
@Override
9999
public String toString() {
100-
return super.toString() + "Frequency="+getFrequency()+", FEC_outer="+getFEC_outerString()+", modulation="+getModulationString(modulation)+", Symbol Rate="+getSymbol_rate()+", FEC_inner="+Descriptor.getFEC_innerString(FEC_inner);
100+
return super.toString() + "Frequency="+ frequency +", FEC_outer="+getFEC_outerString()+", modulation="+getModulationString(modulation)+", Symbol Rate="+ symbol_rate +", FEC_inner="+Descriptor.getFEC_innerString(FEC_inner);
101101
}
102102

103103

src/main/java/nl/digitalekabeltelevisie/data/mpeg/descriptors/CarouselIdentifierDescriptor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class CarouselIdentifierDescriptor extends Descriptor {
5353

5454
private byte[] objectKeyData;
5555

56-
public CarouselIdentifierDescriptor(final byte[] b, final TableSection parent) {
56+
public CarouselIdentifierDescriptor(byte[] b, TableSection parent) {
5757
super(b, parent);
5858
carouselId = Utils.getLong(b, 2, 4, Utils.MASK_32BITS);
5959
if (descriptorLength > 4) {
@@ -78,9 +78,9 @@ public CarouselIdentifierDescriptor(final byte[] b, final TableSection parent) {
7878
}
7979

8080
@Override
81-
public KVP getJTreeNode(final int modus) {
81+
public KVP getJTreeNode(int modus) {
8282

83-
final KVP t = super.getJTreeNode(modus);
83+
KVP t = super.getJTreeNode(modus);
8484
t.add(new KVP("carousel_id", carouselId));
8585
if (descriptorLength > 4) {
8686
t.add(new KVP("format_id", formatId, getFormatIDString(formatId)));

src/main/java/nl/digitalekabeltelevisie/data/mpeg/descriptors/CellFrequencyLinkDescriptor.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static class Cell implements TreeNode{
5555

5656
private final List<SubCell> subCellList = new ArrayList<>();
5757

58-
public Cell(final int id,final long f,final int loop){
58+
public Cell(int id, long f, int loop){
5959
cellId = id;
6060
frequency = f;
6161
subcellInfoLoopLength = loop;
@@ -67,7 +67,7 @@ public void addSubCell(SubCell s){
6767

6868
@Override
6969
public KVP getJTreeNode(int modus) {
70-
final KVP s = new KVP("cell");
70+
KVP s = new KVP("cell");
7171
s.add(new KVP("cell_id", cellId));
7272
s.add(new KVP("frequency", frequency, Descriptor.formatTerrestrialFrequency(frequency)));
7373
s.add(new KVP("subcell_info_loop_length", subcellInfoLoopLength));
@@ -91,17 +91,17 @@ public CellFrequencyLinkDescriptor(byte[] b, TableSection parent) {
9191
super(b, parent);
9292
int t = 0;
9393
while ((t + 6) < descriptorLength) {
94-
final int cell_id = getInt(b, t + 2, 2, Utils.MASK_16BITS);
95-
final long freq = getLong(b, t + 4, 4, MASK_32BITS);
96-
final int subcell_info_loop_length = getInt(b, t + 8, 1, Utils.MASK_8BITS);
97-
final Cell cell = new Cell(cell_id, freq, subcell_info_loop_length);
94+
int cell_id = getInt(b, t + 2, 2, Utils.MASK_16BITS);
95+
long freq = getLong(b, t + 4, 4, MASK_32BITS);
96+
int subcell_info_loop_length = getInt(b, t + 8, 1, Utils.MASK_8BITS);
97+
Cell cell = new Cell(cell_id, freq, subcell_info_loop_length);
9898
cellList.add(cell);
9999
t += 7;
100100
int r = 0;
101101
while (r < subcell_info_loop_length) {
102-
final int cell_id_extension = getInt(b, t + 2 + r, 1, Utils.MASK_8BITS);
103-
final long trans_freq = getLong(b, t + 3, 4, MASK_32BITS);
104-
final SubCell s = new SubCell(cell_id_extension, trans_freq);
102+
int cell_id_extension = getInt(b, t + 2 + r, 1, Utils.MASK_8BITS);
103+
long trans_freq = getLong(b, t + 3, 4, MASK_32BITS);
104+
SubCell s = new SubCell(cell_id_extension, trans_freq);
105105
cell.addSubCell(s);
106106
r = r + 5;
107107
}
@@ -111,7 +111,7 @@ public CellFrequencyLinkDescriptor(byte[] b, TableSection parent) {
111111

112112
@Override
113113
public String toString() {
114-
final StringBuilder buf = new StringBuilder(super.toString());
114+
StringBuilder buf = new StringBuilder(super.toString());
115115
for (Cell cell : cellList) {
116116
buf.append(cell.toString());
117117
}
@@ -122,9 +122,9 @@ public String toString() {
122122

123123

124124
@Override
125-
public KVP getJTreeNode(final int modus){
125+
public KVP getJTreeNode(int modus){
126126

127-
final KVP t = super.getJTreeNode(modus);
127+
KVP t = super.getJTreeNode(modus);
128128
addListJTree(t,cellList,modus,"cell_list");
129129
return t;
130130
}

0 commit comments

Comments
 (0)