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.simple
Class DefaultSimpleScore

    java.lang.Object
      org.drools.planner.core.score.AbstractScore<SimpleScore>
          org.drools.planner.core.score.buildin.simple.DefaultSimpleScore

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

    public final class DefaultSimpleScore

extends AbstractScore<SimpleScore>
implements SimpleScore

Default implementation of `SimpleScore`.

This class is immutable.

See Also:
  `SimpleScore`, Serialized Form

Constructor Summary
`DefaultSimpleScore(int score)`

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

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

Constructor Detail

### DefaultSimpleScore

    public DefaultSimpleScore(int score)

Method Detail

### parseScore

    public static DefaultSimpleScore parseScore(String scoreString)

### valueOf

    public static DefaultSimpleScore valueOf(int score)

### getScore

    public int getScore()

  Description copied from interface: `SimpleScore`
  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 `SimpleScore`
  Returns:
    higher is better, usually negative, 0 if no constraints are broken/fulfilled

### add

    public SimpleScore add(SimpleScore augment)

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

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

### subtract

    public SimpleScore subtract(SimpleScore subtrahend)

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

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

### multiply

    public SimpleScore 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<SimpleScore>`
  Parameters:
    `multiplicand` - value to be multiplied by this Score.
  Returns:
    this * multiplicand

### divide

    public SimpleScore 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<SimpleScore>`
  Parameters:
    `divisor` - value by which this Score is to be divided
  Returns:
    this / divisor

### toDoubleArray

    public double[] toDoubleArray()

  Description copied from interface: `Score`
  Returns an array of doubles representing the Score. When rounding is needed, each rounding should be floored (as defined by `Math.floor(double)`.

  A greater score level uses a lower array index than a lesser score level. The length of the returned array is stable for a specific Score implementation. For example: -0hard/-7soft returns new double{-0.0, -7.0}

  Specified by:
    `toDoubleArray` in interface `Score<SimpleScore>`
  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(SimpleScore other)

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

### 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-2012 JBoss by Red Hat. All Rights Reserved.