Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## cz.pcland.knapsack
Class KnapSack

    java.lang.Object
      cz.pcland.knapsack.KnapSack

All Implemented Interfaces:
  Loadable

    public class KnapSack

extends java.lang.Object
implements Loadable

Field Summary
`java.util.Vector` | `items`
`KnapSackPanel` | `pnl`

Constructor Summary
`KnapSack(double cap)`

Method Summary
`void` | `addItem(double price, double capacity)`
`void` | `addItem(KnapSackItem item)`
`void` | `addRandom(int count)`
`void` | `cleanAllContent()`
`double` | `getCapacity()`
`java.util.Vector` | `getItems()`
`double` | `getSumOfCapacity(BaseIndividual str)`
`void` | `loadFromString(java.lang.String str)`
`void` | `removeItem(int index)`
`java.lang.String` | `saveToFile()`
`void` | `setApproximate(BaseIndividual str)`
`void` | `setCapacity(double cap)`
`void` | `setContent(BaseIndividual str)`
`void` | `setItems(java.util.Vector items)`
`int` | `totalItems()`

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

Field Detail

### items

    public java.util.Vector items

### pnl

    public KnapSackPanel pnl

Constructor Detail

### KnapSack

    public KnapSack(double cap)

Method Detail

### loadFromString

    public void loadFromString(java.lang.String str)

  Specified by:
    `loadFromString` in interface `Loadable`

### saveToFile

    public java.lang.String saveToFile()

### setContent

    public void setContent(BaseIndividual str)

### setApproximate

    public void setApproximate(BaseIndividual str)

### cleanAllContent

    public void cleanAllContent()

### setCapacity

    public void setCapacity(double cap)

### getSumOfCapacity

    public double getSumOfCapacity(BaseIndividual str)

### getCapacity

    public double getCapacity()

### addItem

    public void addItem(double price,
                        double capacity)

### addItem

    public void addItem(KnapSackItem item)

### addRandom

    public void addRandom(int count)

### totalItems

    public int totalItems()

### removeItem

    public void removeItem(int index)

### getItems

    public java.util.Vector getItems()

### setItems

    public void setItems(java.util.Vector items)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD