001package org.openimaj.demos.sandbox; 002/** 003 * Copyright (c) 2011, The University of Southampton and the individual contributors. 004 * All rights reserved. 005 * 006 * Redistribution and use in source and binary forms, with or without modification, 007 * are permitted provided that the following conditions are met: 008 * 009 * * Redistributions of source code must retain the above copyright notice, 010 * this list of conditions and the following disclaimer. 011 * 012 * * Redistributions in binary form must reproduce the above copyright notice, 013 * this list of conditions and the following disclaimer in the documentation 014 * and/or other materials provided with the distribution. 015 * 016 * * Neither the name of the University of Southampton nor the names of its 017 * contributors may be used to endorse or promote products derived from this 018 * software without specific prior written permission. 019 * 020 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 021 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 022 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 023 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 024 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 025 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 026 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 027 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 028 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 029 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 030 */ 031import java.util.Arrays; 032import java.util.Collection; 033 034import org.openimaj.ml.annotation.Annotated; 035 036 037 038public class DirectionScore implements Annotated<Double, Direction> { 039 private Direction dir; 040 private double score; 041 042 public DirectionScore(double score, Direction d) { 043 this.score = score; 044 this.dir = d; 045 } 046 @Override 047 public Double getObject() { 048 return score; 049 } 050 051 @Override 052 public Collection<Direction> getAnnotations() { 053 return Arrays.asList(dir); 054 } 055 056}