001: /*
002: *
003: *
004: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: */
026:
027: package com.sun.kvem.midp.pim;
028:
029: /**
030: * Encapsulation of an empty PIM field
031: *
032: */
033:
034: class EmptyPIMField implements PIMField {
035: /**
036: * Adds a value to a PIM field.
037: * @param attributes properties to update
038: * @param value entry to be updated
039: */
040: public void addValue(int attributes, Object value) {
041: }
042:
043: /**
044: * Gets current value.
045: * @param index field identifier
046: * @return requested field
047: */
048: public Object getValue(int index) {
049: return null;
050: }
051:
052: /**
053: * Sets the field value.
054: * @param attributes field properties
055: * @param value field to update
056: * @param index field offset
057: */
058: public void setValue(int attributes, Object value, int index) {
059: }
060:
061: /**
062: * Gets the field attributes.
063: * @param index field offset
064: * @return coded attribute settings
065: */
066: public int getAttributes(int index) {
067: throw new IndexOutOfBoundsException("No data in field");
068: }
069:
070: /**
071: * Checks field for contents.
072: * @return <code>true</code> if contains data
073: */
074: public boolean containsData() {
075: return false;
076: }
077:
078: /**
079: * Gets the count of values.
080: * @return count
081: */
082: public int getValueCount() {
083: return 0;
084: }
085:
086: /**
087: * Removes the value.
088: * @param index value offset
089: */
090: public void removeValue(int index) {
091: }
092:
093: /**
094: * Check if field contains scalar value.
095: * @return <code>true</code> if scalar value
096: */
097: public boolean isScalar() {
098: return true;
099: }
100:
101: }
|