Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

NameIS.java

00001 package Sct.IS;
00002 
00003 import java.util.*;
00004 import Sct.*;
00005 
00006 public class NameIS extends Name {
00007     protected String ISServer;
00008     
00009     public NameIS(Serializable s) {
00010         super(s);
00011         ISServer = SctNames.getISServer(className);
00012     }
00013     
00014     public NameIS(String name) throws IllegalArgumentException {
00015         super(name);        
00016     }
00017     
00018     public NameIS(String className, String uniqueID) {
00019         super(className, uniqueID);
00020         ISServer = SctNames.getISServer(className);
00021     }
00022     
00023     public String getName() {
00024         return ISServer + "." + convertToC(className) + "." + uniqueID;
00025     }
00026     
00027     public String getISServer() {
00028         return ISServer;
00029     }
00030     
00031     /*
00032      * Format: <ISServer>.<ClassName>.<UniqueID>
00033      */
00034     protected void parse(String name) throws IllegalArgumentException {
00035         try {
00036             StringTokenizer st = new StringTokenizer(name, ".", false);
00037             
00038             ISServer = st.nextToken();
00039             className = convertFromC(st.nextToken());
00040             uniqueID = st.nextToken("").substring(1); //Make sure initial . is removed            
00041         } catch (NoSuchElementException e) {
00042             IllegalArgumentException iae = new IllegalArgumentException("NameIS cannot parse IS name - doesn't match expected format: " + name);   
00043             iae.initCause(e);
00044             throw iae;
00045         }
00046     }    
00047     
00048 }
00049 

Generated on Thu Jul 15 09:55:46 2004 for SCT DAQ/DCS Software - Java by doxygen 1.3.5