me.edwards.des.block
Class Vote

java.lang.Object
  extended by me.edwards.des.block.Vote

public class Vote
extends java.lang.Object

Data structure maintaining a single vote for a single entity. This vote may be for an office or a referendum. Ballots are made up of multiple votes, making the Vote the most basic unit composing Blocks.

Created on: Nov 3, 2015 at 10:41:29 AM

Author:
Matthew Edwards

Field Summary
private  int id
           
private  java.lang.String vote
           
 
Constructor Summary
Vote(int id, java.lang.String vote)
          Creates a new Vote using the specified ID and vote content.

Ex: [ID:1,VOTE:Obama]
 
Method Summary
 byte[] getBytes()
          Returns this vote in binary format as a byte array.
 int getID()
          Gets the vote ID of the office or referendum being voted on.
 java.lang.String getVote()
          Returns the vote content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

private int id

vote

private java.lang.String vote
Constructor Detail

Vote

public Vote(int id,
            java.lang.String vote)
Creates a new Vote using the specified ID and vote content.

Ex: [ID:1,VOTE:Obama]

Parameters:
id - ID of the office or referendum being voted on
vote - Vote content (as a String)
Method Detail

getID

public int getID()
Gets the vote ID of the office or referendum being voted on. Ex: 123

Returns:
ID of the office or referendum being voted on

getVote

public java.lang.String getVote()
Returns the vote content. Ex: Obama

Returns:
Vote content (as a String)

getBytes

public byte[] getBytes()
Returns this vote in binary format as a byte array.

Returns:
Byte array representing this Vote