Advertisement
makispaiktis

Streaming - Streamer.java

Nov 11th, 2019 (edited)
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.34 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class Streamer {
  4.  
  5.     // Variables
  6.     String name;
  7.     String nameOfChannel;
  8.     String nationality;
  9.     int age;
  10.     ArrayList <Bot> botsList;
  11.     ArrayList <String> socials;
  12.    
  13.     // Constructors
  14.     Streamer(){
  15.         name = "";
  16.         nameOfChannel = "";
  17.         nationality = "";
  18.         age = 0;
  19.         botsList = new ArrayList <Bot> ();
  20.         socials = new ArrayList <String> ();
  21.     }
  22.    
  23.     Streamer(String name, String nameOfChannel, String nationality, int age){
  24.         this.name = name;
  25.         this.nameOfChannel = nameOfChannel;
  26.         this.nationality = nationality;
  27.         this.age = age;
  28.         this.botsList = new ArrayList <Bot> ();
  29.         this.socials = new ArrayList <String> ();
  30.     }
  31.    
  32.     Streamer(String name, String nameOfChannel, String nationality, int age, ArrayList <String> socials){
  33.         this.name = name;
  34.         this.nameOfChannel = nameOfChannel;
  35.         this.nationality = nationality;
  36.         this.age = age;
  37.         this.botsList = new ArrayList <Bot> ();
  38.         this.socials = socials;
  39.     }
  40.    
  41.     // Methods
  42.     void showStatus(){
  43.         System.out.println("*********************************");
  44.         System.out.println("Name of streamer: " + name);
  45.         System.out.println("Name of channel:" + nameOfChannel);
  46.         System.out.println("Nationality: " + nationality);
  47.         System.out.println("Age of streamer:" + age);
  48.         System.out.println();
  49.         System.out.println("BotsList of streamer " + name + ": ");
  50.         if(botsList.size() != 0){
  51.             for(int i=0; i<botsList.size(); i++){
  52.                 System.out.println("Bot " + (i+1) + ": " + botsList.get(i).name);
  53.             }
  54.         }
  55.         else{
  56.             System.out.println("No bots yet in channel " + nameOfChannel);
  57.         }
  58.         System.out.println("Socials of streamer " + name + ": ");
  59.         if(socials.size() != 0) {
  60.             for(int i=0; i<socials.size(); i++) {
  61.                 System.out.println(socials.get(i));
  62.             }
  63.         }
  64.         else {
  65.             System.out.println("No socials for streamer " + name + " given in this channel: " + nameOfChannel);
  66.         }
  67.         System.out.println("*********************************");
  68.    
  69.     }   // END OF SHOWSTATUS FUNCTION
  70.    
  71.    
  72.     void showSocials() {
  73.         System.out.println("Socials of streamer '" + name + "' (channel " + nameOfChannel + "): ");
  74.         if(socials.size() != 0) {
  75.             for(int i=0; i<socials.size(); i++) {
  76.                 System.out.println(socials.get(i));
  77.             }
  78.         }
  79.         else {
  80.             System.out.println("No socials for streamer " + name + " given in this channel: " + nameOfChannel);
  81.         }
  82.     }
  83.    
  84.    
  85.    
  86. }   // END OF CLASS STREAMER
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement