01: /***
02: * jwma Java WebMail
03: * Copyright (c) 2000-2003 jwma team
04: *
05: * jwma is free software; you can distribute and use this source
06: * under the terms of the BSD-style license received along with
07: * the distribution.
08: ***/package dtw.webmail.util;
09:
10: /**
11: * Abstract class implementing the
12: * <tt>AbstractIdentifiable</tt> interface for
13: * associated instances.
14: *
15: * @author Dieter Wimberger
16: * @version 0.9.7 07/02/2003
17: */
18: public abstract class AssociatedAbstractIdentifiable extends
19: AbstractIdentifiable {
20:
21: //instance attributes
22: private String m_AssociatorUID;
23:
24: /**
25: * Returns the unique identifier of the
26: * <tt>Associator</tt> of this
27: * <tt>AssociatedAbstractIdentifiable</tt>.
28: *
29: * @return the unique identifier as <tt>String</tt>.
30: */
31: public String getAssociatorUID() {
32: return m_AssociatorUID;
33: }//getAssociatorUID
34:
35: /**
36: * Sets the unique identifier of the
37: * <tt>Associator</tt> of this
38: * <tt>AssociatedAbstractIdentifiable</tt>.
39: *
40: * @param uid the unique identifier as <tt>String</tt>.
41: */
42: public void setAssociatorUID(String uid) {
43: m_AssociatorUID = uid;
44: }//setAssociatorUID
45:
46: /**
47: * Resets the unique identifier of the
48: * <tt>Associator</tt> of this
49: * <tt>AssociatedAbstractIdentifiable</tt>.
50: */
51: public void resetAssociatorUID() {
52: m_AssociatorUID = "";
53: }//resetAssociatorUID
54:
55: /**
56: * Tests if this <tt>AssociatedAbstractIdentifiable</tt>
57: * is associated with a valid <tt>Associator</tt>.
58: */
59: public boolean isAssociated() {
60: if (m_AssociatorUID == null || m_AssociatorUID.length() == 0) {
61: return false;
62: } else {
63: return true;
64: }
65: }//isAssociated
66:
67: }//abstract class AssociatedAbstractIdentifiable
|