alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 * ArrayProperty.java
 *
 * Created on November 25, 2002, 11:40 AM
 */

package org.netbeans.test.editor.app.core.properties;

/**
 *
 * @author  eh103527
 */
public class ArrayProperty implements Property {
    
    private Object value;
    
    private Object[] values;
    
    /** Creates a new instance of ArrayProperty */
    public ArrayProperty(Object val,Object[] vals) {
        value=val;
        values=vals;
    }
    
    public String getProperty() {
        return value.toString();
    }
    
    public void setProperty(String value) {
        boolean found=false;
        for (int i=0;i < values.length;i++) {
            if (values[i].toString().compareTo(value) == 0) {
                this.value=values[i];
                found=true;
                break;
            }
        }
    }
    
    public Object[] getValues() {
        return values;
    }
    
    public Object getValue() {
        return value;
    }
    
}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.