ischool.info340.teamE
Class Place

java.lang.Object
  extended by ischool.info340.teamE.Place

public class Place
extends java.lang.Object

Represents a place in the storage medium


Constructor Summary
Place(int id, int creatorId, java.lang.String name, java.lang.String descr, PlaceManager manager)
          Creates a new instance of place
Place(int creatorId, java.lang.String name, java.lang.String descr, PlaceManager manager)
          Creates a new instance of place, and adds it to the storage media
 
Method Summary
 boolean exists()
           
 int getCreatorId()
           
 java.lang.String getDescr()
           
 int getId()
           
 PlaceManager getManager()
           
 java.lang.String getName()
           
 boolean remove()
          Removes this place from the storage medium and marks it as unusable so future use of this media will generate exceptions.
 boolean restore()
          Inserts this previously removed place back into the storage medium and marks it as usable again.
 boolean update(int creatorId, java.lang.String name, java.lang.String descr)
          Updates this place object and its representation in the storage medium to have a new set of properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Place

public Place(int id,
             int creatorId,
             java.lang.String name,
             java.lang.String descr,
             PlaceManager manager)
Creates a new instance of place

Parameters:
id - The unique identifier in the storage medium for this place
creatorId - The user who created this place
name - The name of this place
descr - The description of this place
manager - The manager for the storage medium in which this place exists

Place

public Place(int creatorId,
             java.lang.String name,
             java.lang.String descr,
             PlaceManager manager)
Creates a new instance of place, and adds it to the storage media

Parameters:
creatorId - The user who created this place
name - The date on which this media was captured or created
descr - The description of this media
manager - The manager for the storage medium in which this place exists
Method Detail

getId

public int getId()

getCreatorId

public int getCreatorId()

getName

public java.lang.String getName()

getDescr

public java.lang.String getDescr()

getManager

public PlaceManager getManager()

update

public boolean update(int creatorId,
                      java.lang.String name,
                      java.lang.String descr)
Updates this place object and its representation in the storage medium to have a new set of properties

Parameters:
creatorId - The user who created this place
name - The name of this place
descr - The description of this place
Returns:
True if the update is successful or false if there was an error

exists

public boolean exists()

remove

public boolean remove()
Removes this place from the storage medium and marks it as unusable so future use of this media will generate exceptions.

Returns:
True if this operation is successful or false if there is an error

restore

public boolean restore()
Inserts this previously removed place back into the storage medium and marks it as usable again.

Returns:
True if this operation is successful or false if there is an error
Throws:
java.lang.IllegalStateException - if this user has not yet been deleted