home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-01-27 | 2.2 KB | 131 lines |
- // Simple Multiuser Server
- // (c) Copyright Justin Couch justin@vlc.com.au
- // The Virtual Light Company 1996
- //
- // From Chapter 20: Late Night VRML 2.0 and java
- //
- // This is the entity class. Each instance of this class represents one entity in
- // the world.
-
- package registry;
-
- class Entity
- {
- public int ID;
- private String nickname;
- private String URL;
- private int flags = 0;
- private String[] public_info;
- private long registration_time = 0;
- private long last_update_time = 0;
- private boolean persistent;
- private boolean is_avatar;
- private String owner;
- private String cname;
-
- // create a new entity. For the start copy the cname as the nickname.
- public Entity(String cn, int new_id, String ident_name)
- {
- cname = cn;
- owner = ident_name;
- nickname = cname;
- ID = new_id;
-
- registration_time = System.currentTimeMillis();
- last_update_time = registration_time;
- }
-
- public long get_registrationTime()
- {
- return(registration_time);
- }
-
- public long get_lastUpdateTime()
- {
- return(last_update_time);
- }
-
- public boolean isPersistent()
- {
- return(persistent);
- }
-
- public boolean isAvatar()
- {
- return(is_avatar);
- }
-
- public void set_owner(String new_name)
- {
- owner = new_name;
- last_update_time = System.currentTimeMillis();
- }
-
- public String get_owner()
- {
- return(owner);
- }
-
- public void set_persistent(boolean val)
- {
- persistent = val;
- last_update_time = System.currentTimeMillis();
- }
-
- public void set_avatar(boolean val)
- {
- is_avatar = val;
- last_update_time = System.currentTimeMillis();
- }
-
- public String get_cname()
- {
- return(cname);
- }
-
- public void set_nickname(String name)
- {
- nickname = name;
- last_update_time = System.currentTimeMillis();
- }
-
- public String get_nickname()
- {
- return(nickname);
- }
-
- public void set_URL(String new_url)
- {
- URL = new_url;
- last_update_time = System.currentTimeMillis();
- }
-
- public String get_URL()
- {
- return(URL);
- }
-
- public void set_flags(int new_flags)
- {
- flags = new_flags;
- last_update_time = System.currentTimeMillis();
- }
-
- public int get_flags()
- {
- return(flags);
- }
-
- public void set_publicInfo(String[] new_info)
- {
- public_info = new_info;
- last_update_time = System.currentTimeMillis();
- }
-
- public String[] get_publicInfo()
- {
- return(public_info);
- }
- }
-
-