Package emometer.model

Examples of emometer.model.Emotions


        HashSet<Emotions> set= new HashSet<Emotions>();
        try {
            int id = Integer.parseInt(jedis.get("ids:emotion"));
            System.out.println(id);
            for (int i = 1; i <= id; i++) {
                Emotions emotions = new Emotions();
                Map<String, String> emotion = jedis.hgetAll("emotion:"+i);
                emotions.setEmotion(Integer.parseInt(emotion.get("emotion").toString()));
                emotions.setCurrentday(new Date(Long.parseLong(emotion.get("day").toString())));
                emotions.setNote(emotion.get("note").toString());
                set.add(emotions);
            }
           
        }catch(Exception e){
            e.printStackTrace();
View Full Code Here


                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    Emotions emotion = new Emotions();
    emotion.setNote(jTextArea1.getText());
    int emonumber = jComboBox1.getSelectedIndex();
    Object[] emolist = Emotions.names.toArray();
    Object[] emovalues =  Emotions.values.toArray();
    for (int i = 0; i < emolist.length; i++) {
        String string = (String) emolist[i];
        Integer value = (Integer) emovalues[i];
        if (string.equals(value)) {
            emotion.setEmotion(emonumber);
        }
    }
    DataHandler.saveEmotion(emotion);
    jTextArea1.setText("");
    jComboBox1.setSelectedIndex(0);
View Full Code Here

}//GEN-LAST:event_jButton1ActionPerformed

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
    HashSet<Emotions> emotion = DataHandler.getEmotion();
    for (Iterator<Emotions> it = emotion.iterator(); it.hasNext();) {
        Emotions emotions = it.next();
        System.out.println(emotions.getNote());
    }
}//GEN-LAST:event_jButton2ActionPerformed
View Full Code Here

TOP

Related Classes of emometer.model.Emotions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.