gishur.core
Class BasicList

java.lang.Object
  |
  +--gishur.core.BasicList
Direct Known Subclasses:
Queue, SimpleList, Stack

public class BasicList
extends java.lang.Object
implements Owner, java.io.Serializable

A rudimentary and efficient doubly connected list. Its purpose is to be used as the basis for the development of other List classes. All the methods of BasicList are protected, which means they are accessible from derived classes (and from classes of the same package), but not from extern classes! The access on ListItems is very restrictive: changes to the connections between the ListItems and to their owners are prevented. To modify a ListItem in a derived class allowAccess(ANY_ACCESS) should be called first and after the modification allowAccess(NO_ACCESS) should be executed.

To permit methods to read data from an object of a class, which is derived from BasicList, the public method getListView() can be overrode, which then returns a ListView object.
The same security mechanisms, with which ListItems certify that they can only be modified by the owning list, make sure that a ListView object can only be created from the owning list - if getListView() is overridden properly. This makes controlled read access possible and data can be hidden and shown as required.

As this class is only intended to be used as basis for other list classes, all methods are protected and most of them receive a lot of parameters. Often a list interval is handed over as argument, which is specified by a first element and either the length, or the last element of the interval. If the length is specified, the last element should be null, if a last element is used to confine the interval, length should be a negative value.

Example:
add(base,start,end,-1) connects the interval from start to end to the element base of the list, add(base,start,null,3) on the other side connects start and the next two elements, which are connected to start, to base.

Although BasicList implements Serializable, ListItem doesn't. If you want to derive a list which works correct with serialization, pay attention to use ListItems which implement the Serializable interface.

Version:
1.0
Author:
Thomas Wolf
See Also:
ListItem, Serialized Form

Field Summary
static byte ANY_ACCESS
          Allow any access.
protected static byte KEY
          Access to the key.
protected static byte LISTITEM
          Access to the ListItem object.
static byte NO_ACCESS
          Allows no access (default).
protected static byte VALUE
          Access to the value.
 
Constructor Summary
protected BasicList()
          Protected constructor.
 
Method Summary
protected  int add(ListItem base, ListItem[] array, int startindex, int length)
          Inserts length ListItems from the ListItem array array beginning with the index startindex after the ListItem base.
protected  int add(ListItem base, ListItem item, ListItem end, int count)
          Inserts an existing chain of the maximum length count beginning with item after the element base into the list.
protected  void allowAccess(byte accesskonst)
          Permits the (temporary) access to ListItems
protected  void clear()
          Deletes the whole list.
protected  java.lang.Object clone(java.util.Hashtable h, int level)
          Clones the entire list according to ControlledCloneable.
protected  boolean contains(ListItem item)
          Returns true, if the list contains the ListItem item.
protected  ListItem copy(ListItem start, ListItem end, int count)
          Returns a copy of the chain of ListItems beginning with start and ending with end or containing not more than count elements altogether.
protected  ListItem copy(ListItem start, ListItem end, int count, boolean cyclic)
          Returns a copy of the chain of ListItems beginning with start and ending with end or containing not more than count elements altogether.
protected  ListItem copy(ListItem start, ListItem end, int count, boolean cyclic, java.util.Hashtable h, int level)
          Returns a copy of the chain of ListItems beginning with start and ending with end or containing not more than count elements altogether.
protected  int cut(ListItem start, ListItem end, int count)
          Cuts the chain beginning with start and ending with end or after count steps (if count>0) from the list.
protected  void cycle(int dist)
          A cyclic Left shift for dist ListItems. (if dist<0, a right shift is performed)
protected  void cycle(ListItem item)
          Performs a cyclic shift until item is the first element of the list.
protected  boolean empty()
          Returns true, if the list is empty.
protected  java.util.Enumeration enumerate(ListItem start, ListItem end, int count, byte objecttype)
          Returns an Enumeration object, which enumerates the specified interval.
 boolean equals(java.lang.Object O)
          Compares two lists.
protected  ListItem find(java.lang.Object O, ListItem start, ListItem end, int count, boolean cyclic)
          Returns the ListItem from the interval between start and end with the maximum length count (if count>0), for which equals(O) is true.
protected  ListItem findClass(java.lang.Class C, int app, ListItem start, ListItem end, int count, boolean cyclic)
          Returns the app-th ListItem from the interval between start and end with the maximum length count (if count>0), which contains an object of class C as key.
protected  ListItem findClosest(java.lang.Object key, Comparitor comparitor, short compare, ListItem start, ListItem end, int count, boolean cyclic)
          Searches a certain part of the list for the ListItem which comes 'closest' to key by using the Comparitor comparitor.
protected  ListItem first()
          Returns the first ListItem of the list.
protected  int getDistance(ListItem i, ListItem j)
          Returns the distance of the ListItems i and j in the list.
protected  int getIndex(ListItem i, boolean fromStart)
          Calculates the index of the ListItem i in the list, counting from the first or the last element.
protected  ListItem getListItem(ListItem base, int count, boolean cyclic)
          Returns the ListItem, which is count steps away from base in the list.
protected  ListItem[] getListItemArray(ListItem start, ListItem end, int count, boolean cyclic)
          Returns an interval from the list as array.
protected  java.lang.String getListString(java.lang.String separator, int width, int itemmode, int expandlevel, boolean len, boolean reverse)
          Returns the string representation of all the elements in the list. the list elements are separated by a separator string and there is a newline after roughly every width characters if width>0.
 ListView getListView()
          Creates a ListView object which allows read access to the list structure, even if the type is not explicitly known.
protected  ListItem last()
          Returns the last ListItem of the list.
protected  int length()
          Returns the number of elements stored in the list.
protected  void move(ListItem start, ListItem end, int count, ListItem base)
          Moves a given chain of the list to another position.
protected  int reconnect(ListItem base, ListItem[] array, int startindex, int length)
          Inserts an interval from an array of ListItems into the list.
protected  int reconnect(ListItem base, ListItem start, ListItem end, int count)
          Inserts the chain of ListItems connected (forwards) to start, which may not contain more than count elements, after base into the list.
protected  int remove(ListItem start, ListItem end, int count)
          Removes the chain beginning with start and ending with end or after count steps (if count>0) from the list.
 boolean requestAccess(int accesstype, java.lang.Object who, java.lang.Object argument)
          The owned object who asks the owner for permission to perform an action of the type accesstype with the parameter argument. {
protected  void reverse(ListItem start, ListItem end, int count)
          Reverses the order of the ListItems in the interval from start to end.
protected  int storeInArray(java.lang.Object[] array, int startindex, int length, ListItem start, byte objecttype, boolean cyclic)
          Stores a part of the list into an array.
 java.lang.String toString()
          Returns a string representation of the object.
 java.lang.String toString(boolean len, int itemmode, int expandlevel)
          Returns a string representation of this list.
protected  int unconnect(ListItem start, ListItem end, int count)
          Unconnects the chain beginning with start and ending with end or after count steps, if count>0, from the list.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_ACCESS

public static final byte NO_ACCESS
Allows no access (default). This means there is no access to the connection of the ListItems:

ANY_ACCESS

public static final byte ANY_ACCESS
Allow any access.

LISTITEM

protected static final byte LISTITEM
Access to the ListItem object.

KEY

protected static final byte KEY
Access to the key.

VALUE

protected static final byte VALUE
Access to the value.
Constructor Detail

BasicList

protected BasicList()
Protected constructor.
Method Detail

getListString

protected java.lang.String getListString(java.lang.String separator,
                                         int width,
                                         int itemmode,
                                         int expandlevel,
                                         boolean len,
                                         boolean reverse)
Returns the string representation of all the elements in the list. the list elements are separated by a separator string and there is a newline after roughly every width characters if width>0. If width<0, then a newline is added every abs(width) ListItems, if width==0, then no newlines are inserted.
Parameters:
separator - separator string between the ListItems
width - width of a row in characters or number of ListItems per line or no newline
itemmode - if ==1, only the keys are added to the string,
if ==2 keys and values are added
if ==3 the complete ListItems are added
expandlevel - meaningless, if <0, else it describes the depth of recursion for lists containing lists,
==0 means no further list items
len - determines if the length of the list should be returned
reverse - if true, the list will be read in the reverse direction

toString

public java.lang.String toString(boolean len,
                                 int itemmode,
                                 int expandlevel)
Returns a string representation of this list.
Parameters:
len - if true include the length
itemmode - if ==1, only the keys are added to the string,
if ==2 keys and values are added
if ==3 the complete ListItems are added
expandlevel - meaningless, if <0, else it describes the depth of recursion for lists containing lists,
==0 means no further list items

toString

public java.lang.String toString()
Returns a string representation of the object.
Returns:
a string representation of the object.
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object O)
Compares two lists. Two list are epual, when they have the same number of ListItems and the i-th element of the first list equals the i-th element of the second list.
Parameters:
O - object to which this will be compared
Returns:
true, if the objects are epual
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

clone

protected java.lang.Object clone(java.util.Hashtable h,
                                 int level)
Clones the entire list according to ControlledCloneable. That means, all ListItems are cloned and connected proper.
BasicList does not implement the Interface ControlledCloneable, but supports its methods!
Parameters:
h - Hashtable to indicate which objects are already cloned
level - indicates how deep the objects should be cloned
Returns:
cloned object
Throws:
InternalError - - if the Object could not be cloned properly
See Also:
ControlledCloneable

length

protected int length()
Returns the number of elements stored in the list.
Returns:
Number of elements

empty

protected boolean empty()
Returns true, if the list is empty.
Returns:
true, if the list is empty.

first

protected ListItem first()
Returns the first ListItem of the list.
Returns:
first ListItem

last

protected ListItem last()
Returns the last ListItem of the list.
Returns:
last ListItem

contains

protected boolean contains(ListItem item)
Returns true, if the list contains the ListItem item. The test is performed in constant running time.
Parameters:
item - to be tested
Returns:
true, if the item is contained in the list.

getListItem

protected ListItem getListItem(ListItem base,
                               int count,
                               boolean cyclic)
Returns the ListItem, which is count steps away from base in the list. If cyclic is true the list is considered to be a cyclic list. If count is negative, the search direction is backward, otherwise it is forward. This method returns null, if base is not contained in the list or the confines of the list are exceeded (only if cyclic==false). If base==null and count>=0 the starting point is the first ListElement. If base==null and count<0 it is the last element.
Parameters:
base - ListItem, to be started with.

getIndex

protected int getIndex(ListItem i,
                       boolean fromStart)
Calculates the index of the ListItem i in the list, counting from the first or the last element. If i is not contained within the list, -1 is returned.
Parameters:
i - ListItem, the index of which will be calculated.
fromStart - if true, the first element has index 0, otherwise the last element has index 0.

getDistance

protected int getDistance(ListItem i,
                          ListItem j)
Returns the distance of the ListItems i and j in the list. A positive return value means, that j can be reached from i by stepping forwards through the list, a negative value indicates, that j can be reached by stepping backwards. If i or j is not contained within the list (or unreachable for any other reason) the integer Integer.MAX_VALUE is returned.
Parameters:
i,j - ListItems, whose distance will be calculated.

find

protected ListItem find(java.lang.Object O,
                        ListItem start,
                        ListItem end,
                        int count,
                        boolean cyclic)
Returns the ListItem from the interval between start and end with the maximum length count (if count>0), for which equals(O) is true. If end==null then end is the last list element. The list is considered to be a cyclic list, if cyclic==true.
Parameters:
O - object to be looked for
start - first ListItem of the interval.
end - last ListItem of the interval (if !=null)
count, - maximum number of ListItems in the interval, if >0
cyclic - if true, the list is considered to be cyclic.
Returns:
the found ListItem or null.

findClosest

protected ListItem findClosest(java.lang.Object key,
                               Comparitor comparitor,
                               short compare,
                               ListItem start,
                               ListItem end,
                               int count,
                               boolean cyclic)
Searches a certain part of the list for the ListItem which comes 'closest' to key by using the Comparitor comparitor. If compare==Comparitor.EQUAL, only one ListItem is returned, whose comparison returned Comparitor.EQUAL. When using Comparitor.BIGGER the smallest ListItem which is bigger than key is returned, when using Comparitor.SMALLER the biggest smaller ListItem is returned. If findClosest(java.lang.Object, gishur.core.Comparitor, short, gishur.core.ListItem, gishur.core.ListItem, int, boolean) is called with comparitor==null, then a default comparitor is used.
start, end, count and cyclic describe the list interval. If key is a ListItem, then ListItems are compared, otherwise keys are compared. If key==null the maximum value is searched for when compare==Comparitor.BIGGER and the minimum value is searched for, when compare==Comparitor.SMALLER (Comparitor.EQUAL leads to no sensible result if key==null).
Parameters:
key - object to be compared to
comparitor - comparitor object
compare - the type of the comparison: if Comparitor.EQUAL, equal objects are searched for,
if Comparitor.BIGGER or Comparitor.SMALLER the smallest bigger or the biggest smaller object is searched for respectively.
start - first ListItem of the interval.
end - last ListItem of the interval (if !=null)
count, - maximum number of ListItems in the interval, if >0
cyclic - if true, the list is considered to be cyclic.
Returns:
the found ListItem or null.

findClass

protected ListItem findClass(java.lang.Class C,
                             int app,
                             ListItem start,
                             ListItem end,
                             int count,
                             boolean cyclic)
Returns the app-th ListItem from the interval between start and end with the maximum length count (if count>0), which contains an object of class C as key. If end==null (and count<0) then end is the last list element. The list is considered to be a cyclic list, if cyclic==true.
Parameters:
C - class of the object searched for
app - required number of occurrences of the searched for object
start - first ListItem of the interval.
end - last ListItem of the interval (if !=null)
count, - maximum number of ListItems in the interval, if >0
cyclic - if true, the list is considered to be cyclic.
Returns:
the found ListItem or null.

getListItemArray

protected ListItem[] getListItemArray(ListItem start,
                                      ListItem end,
                                      int count,
                                      boolean cyclic)
Returns an interval from the list as array. If cyclic==false, the interval between start and end (or vice versa, if end comes before start) is returned. If cyclic==true, the list is treated as a cyclic list and the first element of the array is always start. start and end must both be elements of the list and be reachable from each other, otherwise null is returned. If start==null, then start is set to first(), if end==null, count objects or (if count<0) all the elements to the end of the list are copied into the array.
Parameters:
start - first ListItem of the interval.
end - last ListItem of the interval (if !=null)
count, - maximum number of ListItems in the interval, if >0
cyclic - if true, the list is considered cyclic
Returns:
array containing the ListItems

storeInArray

protected int storeInArray(java.lang.Object[] array,
                           int startindex,
                           int length,
                           ListItem start,
                           byte objecttype,
                           boolean cyclic)
Stores a part of the list into an array. storeInArray also works with chains of ListItems, which do not belong to the list or are not connected to the rest of the stored objects. But cyclic should not be true in this case. If start==null, then start is set to first().
Parameters:
array - into which the objects will be stored
startindex - the starting index of the array
length - number of objects to be stored
start - first ListItem to be stored
objecttype - indicates, which object type will de stored:
cyclic - if true, the list is considered cyclic
Returns:
the actual number of stored elements

copy

protected ListItem copy(ListItem start,
                        ListItem end,
                        int count)
Returns a copy of the chain of ListItems beginning with start and ending with end or containing not more than count elements altogether. If start==0, start is set to {link#first()}. if count<0, the interval ends with end (or {link#last()}, if end==null). The new List has no owner. The objects contained within the Listitems are not cloned.
Parameters:
start - first element of the interval
end - last element of the interval, if end!=null
count, - maximum number of ListItems in the interval, if >=0
Returns:
first element of the new list

copy

protected ListItem copy(ListItem start,
                        ListItem end,
                        int count,
                        boolean cyclic)
Returns a copy of the chain of ListItems beginning with start and ending with end or containing not more than count elements altogether. If start==0, start is set to {link#first()}. if count<0, the interval ends with end (or {link#last()}, if end==null). The new List has no owner. The objects contained within the Listitems are not cloned.
Parameters:
start - first element of the interval
end - last element of the interval, if end!=null
count, - maximum number of ListItems in the interval, if >=0
cyclic - if true, the list is considered to be cyclic
Returns:
first element of the new list

copy

protected ListItem copy(ListItem start,
                        ListItem end,
                        int count,
                        boolean cyclic,
                        java.util.Hashtable h,
                        int level)
Returns a copy of the chain of ListItems beginning with start and ending with end or containing not more than count elements altogether. If start==null, start is set to {link#first()}. if count<0, the interval ends with end (or {link#last()}, if end==null). The new List has no owner. The objects contained within the ListItems are cloned according to level and h in ControlledCloneable.
Parameters:
start - first element of the interval
end - last element of the interval, if end!=null
count, - maximum number of ListItems in the interval, if >=0
h - Hashtable to indicate which objects are already cloned
level - indicates how deep the objects should be cloned
cyclic - if true, the list is considered to be cyclic
Returns:
first element of the new list
See Also:
ControlledCloneable

enumerate

protected java.util.Enumeration enumerate(ListItem start,
                                          ListItem end,
                                          int count,
                                          byte objecttype)
Returns an Enumeration object, which enumerates the specified interval.
Parameters:
start - first element of the interval (if ==null, start is set to first())
end - last element of the interval
count - maximum number of elements in the interval
objecttype - constant to spicify the return value of nextElement() (i.e. KEY, VALUE or LISTITEM).

add

protected int add(ListItem base,
                  ListItem item,
                  ListItem end,
                  int count)
Inserts an existing chain of the maximum length count beginning with item after the element base into the list. If base==null, the chain is inserted at the beginning of the list.
The ListItems are inserted directly, if ListItem.setOwningList(gishur.core.Owner) could set the owner of the new ListItems successfully. If ListItem.setOwningList(gishur.core.Owner) was unsuccessful for an ListItem, this item is cloned (flat) with ListItem.clone() and the copy is inserted instead, provided ListItem.setOwningList(gishur.core.Owner) allows a change of the owner of this copy (this should normally be no problem, otherwise the process is aborted). The length of the list is increased by the number of objects inserted. The number of inserted items is returned.
Parameters:
base - ListItem, after which the new items will be inserted or null, if the new interval is to be inserted at the beginning of the list
item - ListItem or interval of ListItems, which should be inserted
end - end of the interval, which should be inserted if end!=null
count - maximum number of ListItems to be inserted. If count<0, the whole interval is inserted.
Returns:
actual number of inserted elements

add

protected int add(ListItem base,
                  ListItem[] array,
                  int startindex,
                  int length)
Inserts length ListItems from the ListItem array array beginning with the index startindex after the ListItem base. If base==0, the items are inserted at the beginning of the list. The ListItems are inserted directly, if ListItem.setOwningList(gishur.core.Owner) could set the owner of the new ListItems successfully. If ListItem.setOwningList(gishur.core.Owner) was unsuccessful for an ListItem, this item is cloned (flat) with clone() and the copy is inserted instead, provided ListItem.setOwningList(gishur.core.Owner) allows a change of the owner of this copy (this should normally be no problem, otherwise this ListItem is ignored, but the other objects may still be inserted). The length of the list is increased by the number of elements inserted.
Parameters:
base - ListItem, after which the new elements are inserted
array - array of ListItems
startindex - the starting index in the array
length - maximum number of elements from the array to be inserted
Returns:
actual number of inserted elements

reconnect

protected int reconnect(ListItem base,
                        ListItem start,
                        ListItem end,
                        int count)
Inserts the chain of ListItems connected (forwards) to start, which may not contain more than count elements, after base into the list. All the elements of the chain should already belong to the list! If this is not the case, a failure will occur while connecting and a LinkException will be thrown. base should also belong to the list. If base==null, the chain is attached to the beginning of the list. This method does not change the number of elements in the list!
Parameters:
base - ListItem, after which should be inserted
start - ListItem or chain of ListItems to be inserted
end - end of the interval, which should be inserted (if end!=null)
count - maximum number of ListItems to be inserted. If count<0, the whole interval is inserted from start to end (if end!=null) or to the last element of the chain.
Returns:
actual number of inserted elements

reconnect

protected int reconnect(ListItem base,
                        ListItem[] array,
                        int startindex,
                        int length)
Inserts an interval from an array of ListItems into the list. All of the elements of the array should already belong to the list! Elements which do not belong to the list are not inserted. base should also belong to the list. If base==null, the chain is attached to the beginning of the list. This method does not change the number of elements in the list!
Parameters:
base - ListItem, after which should be inserted
array - array of ListItems to be inserted
startindex - the starting index in the array
length - maximum number of elements from the array to be inserted
Returns:
actual number of inserted elements

cut

protected int cut(ListItem start,
                  ListItem end,
                  int count)
Cuts the chain beginning with start and ending with end or after count steps (if count>0) from the list. The number of actually cut away ListItems is returned.
Parameters:
start - first ListItem to be cut away
end - last ListItem to be cut away
count - maximum number of ListItems to be cut away, if >0
Returns:
actual number of cut away ListItems

remove

protected int remove(ListItem start,
                     ListItem end,
                     int count)
Removes the chain beginning with start and ending with end or after count steps (if count>0) from the list. If references to the removed ListItems exist, these ListItems still contain their data, but are no longer connected.
Parameters:
start - first ListItem to be removed
end - last ListItem to be removed
count - maximum number of ListItems to be removed, if >0
Returns:
actual number of removed ListItems

unconnect

protected int unconnect(ListItem start,
                        ListItem end,
                        int count)
Unconnects the chain beginning with start and ending with end or after count steps, if count>0, from the list. This does not change the number of the list elements.
Parameters:
start - first ListItem to be unconnected
end - last ListItem to be unconnected
count - maximum number of ListItems to be unconnected, if >0
Returns:
actual number of unconnected ListItems

clear

protected void clear()
Deletes the whole list. If failures occur during deletion while freeing the ListItems (this can only happen with uncorrect ListItem implementations), they are catched and the list is deleted anyway. (In this case ListItems may remain that pretendedly belong to the list...).

move

protected void move(ListItem start,
                    ListItem end,
                    int count,
                    ListItem base)
Moves a given chain of the list to another position.
Parameters:
start - the ListItem where the chain starts (if null the chain starts at the beginning)
end - the ListItem where the chain ends (if null the end is specified through count (if count>=0) or through the end of the list). end must lie after start, otherwise the chain goes to the end of the list.
count - if count>=0 this specifies the length of the chain (if end!=null in addition, the shorter chain will be taken)
base - the ListItem after that the chain will be inserted (if base==null, the chain will be inserted at the beginning of the list)

cycle

protected void cycle(ListItem item)
Performs a cyclic shift until item is the first element of the list. Constant runtime.
Parameters:
item - ListItem, that will become the first list element

cycle

protected void cycle(int dist)
A cyclic Left shift for dist ListItems. (if dist<0, a right shift is performed)
Parameters:
dist - number of steps to shifted

reverse

protected void reverse(ListItem start,
                       ListItem end,
                       int count)
Reverses the order of the ListItems in the interval from start to end. If start==0, start is set to the first item of the list. The interval contains no more than count Listitems (if count>0). If end==null and count<0, the list is reversed from start to the last ListItem.
Parameters:
start - first ListItem
end - last ListItem (or ==null)
count - length of the interval (if count>0)

getListView

public ListView getListView()
Creates a ListView object which allows read access to the list structure, even if the type is not explicitly known. If a structure wants to grant (restricted) read access, this method must be overridden like this:
  public synchronized ListView getListView() {
  allowAccess(ANY_ACCESS);
  ListView view=new ListView(this,access_mode);
  allowAccess(NO_ACCESS);
 	return view;
 }
 
The calls to allowAccess(byte) are necessary for the list to return true to requests from the ListView through requestAccess(int, java.lang.Object, java.lang.Object) and that the ListView does not cause any errors during the construction. As the method is synchronized, no other ListView can get access to the list at the same time. Note, that synchronized may not be omitted when overriding the method! The constant access_mode contains the rights of the ListView.
Returns:
ListView for read access if permitted, else null or a restrictive ListView.
See Also:
ListView

allowAccess

protected void allowAccess(byte accesskonst)
Permits the (temporary) access to ListItems

requestAccess

public boolean requestAccess(int accesstype,
                             java.lang.Object who,
                             java.lang.Object argument)
The owned object who asks the owner for permission to perform an action of the type accesstype with the parameter argument. BasicList allows all actions if allowAccess(byte) has removed all restrictions - otherwise the following actions are not permitted:
ListItem.SET_OWNER, ListItem.REMOVE, ListItem.CLEAR_CONNECTIONS, ListItem.CONNECT_FORWARD, ListItem.CONNECT_BACKWARD and ListView.LISTVIEW_ACCESS,
Specified by:
requestAccess in interface Owner
Parameters:
accesstype - type of the action
who - object, that asks for access
argument - argument of the action
Returns:
true, if the owner permits the action, otherwise false