|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface to a Clipboard component.
To properly encapsulate information within the component, we use factory methods to generate the parameters that external components need to pass into our component.
This interface is to be used by those components that require an API-interface to the clipboard component. If an Microsoft-Office-like Clipboard GUI is required, then the IClipboardGUI interface should be the means by which the clipboard is interacted.
Method Summary | |
void |
clear()
Clear the contents of the clipboard |
boolean |
insert(IItem i)
Inserts the given object conforming to the IItem interface into the clipboard. |
IDataType |
newDataTypeInstance(java.lang.String s)
Constructs an object conforming to the IDataType interface given a String object. |
IItem |
newItemInstance(IDataType type,
java.lang.Object o)
Constructs an object conforming to the IItem interface given an IDataType and object |
IItem |
retrieve()
Retrieves the last IItem inserted into the clipboard. |
IItem |
retrieve(IDataType type)
Retrieves most recent IItem inserted into clipboard of given type. |
IItem |
retrieveNth(int n)
Returns the nth last IItem inserted into the Clipboard |
IItem |
retrieveNth(int n,
IDataType type)
Returns the nth IItem in the clipboard that is a sub-type of given IDataType. |
java.util.Enumeration |
types()
Return Enumeration of IDataType objects representing the clipboard contents |
Method Detail |
public void clear()
PRE: none
POST: clipboard is empty
Modified V1.1 to work with GUI
public boolean insert(IItem i)
PRE: none
POST: clipboard.size() = clipboard'.size() + 1.
i is the next item to be retrieved.
i
- edu.wpi.cs.cs509.graph.clipboard.Item
true
if Item successfully added.public IDataType newDataTypeInstance(java.lang.String s) throws ClipboardException
ClipboardException
- If String refers to non-valid Java type.public IItem newItemInstance(IDataType type, java.lang.Object o) throws ClipboardException
type
- edu.wpi.cs.cs509.graph.clipboard.IDataTypeo
- java.lang.Object
ClipboardException
- If type was not previously constructed by clipboard.public IItem retrieve() throws ClipboardException
PRE: clipboard.size() > 1
POST: clipboard unchanged.
ClipboardException
- If clipboard is empty.public IItem retrieve(IDataType type) throws ClipboardException
PRE: clipboard.size() > 1
POST: clipboard unchanged.
type
- edu.wpi.cs.cs509.graph.clipboard.IDataType
ClipboardException
- No such type exists in the clipboard.public IItem retrieveNth(int n) throws ClipboardException
PRE: clipboard.size() > n
POST: clipboard unchanged.
n
- int
ClipboardException
- If n is invalid given state of clipboard.public IItem retrieveNth(int n, IDataType type) throws ClipboardException
PRE: clipboard.size() > n
POST: clipboard unchanged.
n
- inttype
- edu.wpi.cs.cs509.graph.clipboard.IDataType
ClipboardException
- the nth object of type
does not exist in clipboard.public java.util.Enumeration types()
PRE: none
POST: clipboard unchanged.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |