Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.drools.planner.core.score.buildin.simpledouble
Class DefaultSimpleDoubleScore

    java.lang.Object
      org.drools.planner.core.score.AbstractScore<SimpleDoubleScore>
          org.drools.planner.core.score.buildin.simpledouble.DefaultSimpleDoubleScore

All Implemented Interfaces:
  Serializable, Comparable<SimpleDoubleScore>, SimpleDoubleScore, Score<SimpleDoubleScore>

    public final class DefaultSimpleDoubleScore

extends AbstractScore<SimpleDoubleScore>
implements SimpleDoubleScore

Default implementation of `SimpleDoubleScore`.

This class is immutable.

See Also:
  `SimpleDoubleScore`, Serialized Form

Constructor Summary
`DefaultSimpleDoubleScore(double score)`

Method Summary
`SimpleDoubleScore` | `add(SimpleDoubleScore augment)` Returns a Score whose value is (this + augment).
`int` | `compareTo(SimpleDoubleScore other)`
`SimpleDoubleScore` | `divide(double divisor)` Returns a Score whose value is (this / divisor).
`boolean` | `equals(Object o)`
`double` | `getScore()` The total of the broken negative constraints and fulfilled postive hard constraints.
`int` | `hashCode()`
`SimpleDoubleScore` | `multiply(double multiplicand)` Returns a Score whose value is (this * multiplicand).
`static DefaultSimpleDoubleScore` | `parseScore(String scoreString)`
`SimpleDoubleScore` | `subtract(SimpleDoubleScore subtrahend)` Returns a Score whose value is (this - subtrahend).
`double[]` | `toDoubleLevels()` Returns an array of doubles representing the Score.
`String` | `toString()`
`static DefaultSimpleDoubleScore` | `valueOf(double score)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### DefaultSimpleDoubleScore

    public DefaultSimpleDoubleScore(double score)

Method Detail

### parseScore

    public static DefaultSimpleDoubleScore parseScore(String scoreString)

### valueOf

    public static DefaultSimpleDoubleScore valueOf(double score)

### getScore

    public double getScore()

  Description copied from interface: `SimpleDoubleScore`
  The total of the broken negative constraints and fulfilled postive hard constraints. Their weight is included in the total. The score is usually a negative number because most use cases only have negative constraints.

  Specified by:
    `getScore` in interface `SimpleDoubleScore`
  Returns:
    higher is better, usually negative, 0 if no constraints are broken/fulfilled

### add

    public SimpleDoubleScore add(SimpleDoubleScore augment)

  Description copied from interface: `Score`
  Returns a Score whose value is (this + augment).

  Specified by:
    `add` in interface `Score<SimpleDoubleScore>`
  Parameters:
    `augment` - value to be added to this Score
  Returns:
    this + augment

### subtract

    public SimpleDoubleScore subtract(SimpleDoubleScore subtrahend)

  Description copied from interface: `Score`
  Returns a Score whose value is (this - subtrahend).

  Specified by:
    `subtract` in interface `Score<SimpleDoubleScore>`
  Parameters:
    `subtrahend` - value to be subtracted from this Score
  Returns:
    this - subtrahend, rounded as necessary

### multiply

    public SimpleDoubleScore multiply(double multiplicand)

  Description copied from interface: `Score`
  Returns a Score whose value is (this * multiplicand). When rounding is needed, it should be floored (as defined by `Math.floor(double)`.

  Specified by:
    `multiply` in interface `Score<SimpleDoubleScore>`
  Parameters:
    `multiplicand` - value to be multiplied by this Score.
  Returns:
    this * multiplicand

### divide

    public SimpleDoubleScore divide(double divisor)

  Description copied from interface: `Score`
  Returns a Score whose value is (this / divisor). When rounding is needed, it should be floored (as defined by `Math.floor(double)`.

  Specified by:
    `divide` in interface `Score<SimpleDoubleScore>`
  Parameters:
    `divisor` - value by which this Score is to be divided
  Returns:
    this / divisor

### toDoubleLevels

    public double[] toDoubleLevels()

  Description copied from interface: `Score`
  Returns an array of doubles representing the Score. Each double represents 1 score level. A greater score level uses a lower array index than a lesser score level.

  When rounding is needed, each rounding should be floored (as defined by `Math.floor(double)`. The length of the returned array must be stable for a specific `Score` implementation.

  For example: -0hard/-7soft returns new double{-0.0, -7.0}

  Specified by:
    `toDoubleLevels` in interface `Score<SimpleDoubleScore>`
  Returns:
    never null

### equals

    public boolean equals(Object o)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### compareTo

    public int compareTo(SimpleDoubleScore other)

  Specified by:
    `compareTo` in interface `Comparable<SimpleDoubleScore>`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.