org.rad.qa.core.QuoteAnalyzerOutput.java Source code

Java tutorial

Introduction

Here is the source code for org.rad.qa.core.QuoteAnalyzerOutput.java

Source

/*
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * All of the source code for this project is ruled under the GNU General Public License, version 3.
 * Please refer to http://www.gnu.org/licenses/gpl-3.0.txt for additional information and legal text.
 *
 * This code is part of my Master dissertation for MOSS/ISCTE/Portugal.
 * Please contact me at rudradixit at gmail dot com.
 */

package org.rad.qa.core;

import org.apache.hadoop.io.MapWritable;

public class QuoteAnalyzerOutput extends MapWritable {
    private String ticker;

    public QuoteAnalyzerOutput(String ticker) {
        this.ticker = ticker;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();

        sb.append(ticker);
        sb.append(",").append(get(QuoteAnalyzerConstants.OPEN));
        sb.append(",").append(get(QuoteAnalyzerConstants.HIGH));
        sb.append(",").append(get(QuoteAnalyzerConstants.LOW));
        sb.append(",").append(get(QuoteAnalyzerConstants.CLOSE));
        sb.append(",").append(get(QuoteAnalyzerConstants.VOLUME));

        return sb.toString();
    }
}