com.amoebaman.kitmaster.objects
Class Book

java.lang.Object
  extended by com.amoebaman.kitmaster.objects.Book

public class Book
extends java.lang.Object

User-friendly interface for manipulating book pages/titles/authors. Uses MC-native NBT tags to manage data.

Author:
Someone else

Constructor Summary
Book(java.io.File file)
          Constructs a book by reading its contents from a file.
Book(org.bukkit.inventory.ItemStack item)
          Constructs the wrapper for an ItemStack.
 
Method Summary
 void addPages(java.lang.String[] newPages)
          Adds pages to the book.
 java.lang.String getAuthor()
          Gets the author of this book.
 org.bukkit.inventory.ItemStack getItemStack()
          Gets the ItemStack that this Book is currently wrapping.
 java.lang.String[] getPages()
          Gets the pages contained by this book.
 java.lang.String getTitle()
          Gets the title of this book.
 void saveToFile(java.io.File file)
          Saves this book to a file.
 void setAuthor(java.lang.String author)
          Sets the author of this book.
 void setPages(java.lang.String[] newPages)
          Sets the book's pages.
 void setTitle(java.lang.String title)
          Sets the title of this book.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Book

public Book(org.bukkit.inventory.ItemStack item)
Constructs the wrapper for an ItemStack.

Parameters:
item - The item to wrap.

Book

public Book(java.io.File file)
Constructs a book by reading its contents from a file.

Parameters:
file - The file to read from.
Method Detail

getPages

public java.lang.String[] getPages()
Gets the pages contained by this book.

Returns:
The pages.

getAuthor

public java.lang.String getAuthor()
Gets the author of this book.

Returns:
The author.

getTitle

public java.lang.String getTitle()
Gets the title of this book.

Returns:
The title.

setPages

public void setPages(java.lang.String[] newPages)
Sets the book's pages.

Parameters:
newPages - The new pages.

addPages

public void addPages(java.lang.String[] newPages)
Adds pages to the book.

Parameters:
newPages - The pages to add.

setAuthor

public void setAuthor(java.lang.String author)
Sets the author of this book.

Parameters:
author - The new author.

setTitle

public void setTitle(java.lang.String title)
Sets the title of this book.

Parameters:
title - The new title.

saveToFile

public void saveToFile(java.io.File file)
Saves this book to a file.

Parameters:
file - The file to save the book to.

getItemStack

public org.bukkit.inventory.ItemStack getItemStack()
Gets the ItemStack that this Book is currently wrapping.

Returns:
The ItemStack that this Book represents.