org.geebis.books.model.item.nonretail
Class Bundle

java.lang.Object
  extended by org.geebis.books.model.item.Item
      extended by org.geebis.books.model.item.nonretail.NonRetailItem
          extended by org.geebis.books.model.item.nonretail.Bundle
All Implemented Interfaces:
java.io.Serializable

@Name(value="bundle")
public class Bundle
extends NonRetailItem
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
Bundle()
           
Bundle(java.lang.String name)
           
 
Method Summary
 void addLine(BundleLine line)
          Adds a line to this bundle
 double calculateCost()
          Calculates the cost of this bundle.
 java.lang.Boolean getExpanded()
          Gets whether this bundle is expanded or not
 java.util.List<BundleLine> getLines()
          Gets the lines for this bundle
 void removeLine(BundleLine line)
          Removes a line from this bundle
 void setExpanded(java.lang.Boolean expanded)
          Sets the expanded property of this bundle
 void setLines(java.util.List<BundleLine> lines)
          Sets the lines for this bundle
 
Methods inherited from class org.geebis.books.model.item.Item
getDescription, getId, getName, getSalesAccount, getVersion, setDescription, setId, setName, setSalesAccount, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bundle

public Bundle()

Bundle

public Bundle(java.lang.String name)
Method Detail

getExpanded

public java.lang.Boolean getExpanded()
Gets whether this bundle is expanded or not

Returns:
true if this bundle is expanded, else if otherwise

setExpanded

public void setExpanded(java.lang.Boolean expanded)
Sets the expanded property of this bundle

Parameters:
expanded - whether or not this bundle should be expanded

getLines

public java.util.List<BundleLine> getLines()
Gets the lines for this bundle

Returns:
the lines for this group

setLines

public void setLines(java.util.List<BundleLine> lines)
Sets the lines for this bundle

Parameters:
lines - the new lines for this bundle

calculateCost

public double calculateCost()
Calculates the cost of this bundle. The cost of a bundle is the sum of the costs of the items in the bundle

Returns:
the cost of the bundle

addLine

public void addLine(BundleLine line)
Adds a line to this bundle

Parameters:
line - the line to add

removeLine

public void removeLine(BundleLine line)
Removes a line from this bundle

Parameters:
line - the line to remove