ilex.var.NamedVariableList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opendcs Show documentation
Show all versions of opendcs Show documentation
A collection of software for aggregatting and processing environmental data such as from NOAA GOES satellites.
The newest version!
/*
* $Id$
*/
package ilex.var;
import java.util.*;
import ilex.var.IFlags;
import ilex.var.NamedVariable;
/**
* NamedVariableList is a collection of named variables.
*/
public class NamedVariableList implements IFlags
{
private Vector nvars;
private int flags;
/**
* Constructs a new empty named variable list with a zero flag value.
*/
public NamedVariableList( )
{
nvars = new Vector();
flags = 0;
}
/**
* Constructs a new empty named variable list with a specific flag value.
* @param flags
*/
public NamedVariableList( int flags )
{
this();
this.flags = flags;
}
//======== Methods for getting/setting/checking the flags ===========
/**
* Gets the list flags value.
* These are flags on the list as a whole. Each NamedVariable in the
* list also has its own flags value.
* @return
*/
public int getFlags( )
{
return flags;
}
/**
* Sets the list flags value.
* These are flags on the list as a whole. Each NamedVariable in the
* list also has its own flags value.
* @param f
*/
public void setFlags( int f )
{
flags = f;
}
/**
* Returns true if this list has been changed.
* A list has been changed if a variable has been added or removed, or
* if any variable in the list has had its value modified.
* @return
*/
public boolean isChanged( )
{
if ((flags & IFlags.IS_CHANGED)!=0)
return true;
for(int i = 0; i