package com.google.sps.data;
import com.google.sps.data.PropertyNames;
import com.google.sps.data.Query;
import com.google.sps.data.SentimentTools;
import com.google.sps.data.Video;
import com.google.appengine.api.datastore.Entity;
import com.google.gson.Gson;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import java.net.URL;
import java.net.MalformedURLException;

// Represents a video, including its ID, title, description, and captions.
public class VideoAnalysis {
    private static float sentimentScore;
    private static float sentimentMagnitude;
    private static String query;
    private static int QUERY_SIZE = 7;
    
    public VideoAnalysis(Video video) {
        SentimentTools sentimentAnalysis = new SentimentTools(video);
        Query queryAnalysis = new Query(video, QUERY_SIZE);
        this.sentimentScore = SentimentTools.getScore();
        this.sentimentMagnitude = SentimentTools.getMagnitude();
        this.query = queryAnalysis.toString();
    }

    public VideoAnalysis(String _sentimentScore, String _sentimentMagnitude, String _query) {
        this.sentimentScore = _sentimentScore;
        this.sentimentMagnitude = _sentimentMagnitude;
        this.query = _query;
    }

    public void setSentimentScore(float score){
        this.sentimentScore = score;
    }

    public float getSentimentScore(){
        return this.sentimentScore;
    }

    public String setSentimentMagnitude(float magnitude) {
        this.sentimentMagnitude = score;
    }

    public float getSentimentMagnitude() {
        return this.sentimentMagnitude;
    }

    public void setQuery(String query){
        this.query = query;
    }

    public void getQuery(){
        return this.query;
    }

@@ -22,16 +22,45 @@
 s.data;%0A
+import com.google.gson.Gson;%0A
 import c
@@ -208,306 +208,122 @@
 eo;%0A
-import com.google.appengine.api.datastore.Entity;%0Aimport com.google.gson.Gson;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport java.net.URL;%0Aimport java.net.MalformedURLException;%0A%0A// Represents a video, including
+%0A// Represents a video analysis, holds the results from an analysis and can also analyze a video that
  i
-t
 s 
-ID, title, description, and captions
+passed in
 .%0Apu
@@ -512,16 +512,134 @@
 7;%0A    %0A
+    //If given a video we will run analysis on it !!THIS IS SLOWER THAN JUST PASSING IN THE VALUES IF YOU HAVE THEM!!%0A
     publ
@@ -968,32 +968,102 @@
 tring();%0A    %7D%0A%0A
+    //Pass in the results from a Video analysis to create this object%0A
     public Video

refactor VideoAnalysis class to be more readable