01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.rewriter.rom;
06:
07: import com.sun.portal.rewriter.util.Constants;
08:
09: /**
10: * @version 1.0 12/15/2001
11: * @author Raja Nagendra Kumar, Nagendra.Raja@sun.com
12: */
13: public abstract class RuleCollection implements Rule {
14: private static final String[] messages = { "Collection Type can't be ", //0
15: };
16:
17: private final String collectionID;
18:
19: protected RuleCollection(final String aCollectionID)
20: throws InvalidCollectionIDException {
21: if (aCollectionID == null
22: || aCollectionID.trim().equals(Constants.EMPTY_STRING)) {
23: throw new InvalidCollectionIDException(messages[0]
24: + aCollectionID);
25: }
26: collectionID = aCollectionID;
27: }//constructor
28:
29: /*
30: setCollectionID() is not required as this has to passed during
31: constructing phase and hence collectionID is declared final
32: */
33: public String getCollectionID() {
34: return collectionID;
35: }//getCollectionID()
36:
37: public abstract int size();
38:
39: public boolean isEmpty() {
40: return (size() == 0);
41: }//isEmpty()
42:
43: }//class RuleCollection
|