org.griphyn.vdl.classes
Class Value

java.lang.Object
  extended by org.griphyn.vdl.Chimera
      extended by org.griphyn.vdl.classes.VDL
          extended by org.griphyn.vdl.classes.Value
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
List, Scalar

public abstract class Value
extends VDL
implements Cloneable, Serializable

This class is the base class for Scalar and List child classes.

Version:
$Revision: 50 $
Author:
Jens-S. V??ckler, Yong Zhao
See Also:
Serialized Form

Field Summary
static int LIST
          Denotes a list component.
private  String m_name
          Deprecated. This is the name for a value element. Originally we thought to employ this value, but it is currently unused.
static int SCALAR
          Denotes a scalar component, which is always a leaf.
 
Constructor Summary
Value()
          Default ctor.
 
Method Summary
abstract  Object clone()
          Creates and returns a copy of this object.
abstract  boolean containsLFN(String filename, int linkage)
          Determines if the Value contains an LFN of the specified linkage.
abstract  List getAllLFN(int linkage)
          Determines all LFN instances of a given scalar that match the specified linkage.
abstract  int getContainerType()
          This method determines which container is being used in the abstract base class in order to avoid typeof constructs.
abstract  List getLFNList(int linkage)
          Determines all LFN instances of a given scalar that match the specified linkage.
 String getName()
          Deprecated. the attribute is currently unused.
abstract  String getSymbolicType()
          This method determines which container is being used in the abstract base class in order to kludgy statements when printing debug info.
static boolean isInRange(int x)
          Predicate function to determine, if a container type is within the legal range of values.
 void setName(String name)
          Deprecated. the name attribute is currently unused.
 
Methods inherited from class org.griphyn.vdl.Chimera
escape, quote, toString, toString, toXML, toXML, toXML, writeAttribute
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_name

private String m_name
Deprecated. This is the name for a value element. Originally we thought to employ this value, but it is currently unused.

SCALAR

public static final int SCALAR
Denotes a scalar component, which is always a leaf.

See Also:
getContainerType(), Scalar.getContainerType(), Constant Field Values

LIST

public static final int LIST
Denotes a list component.

See Also:
getContainerType(), List.getContainerType(), Constant Field Values
Constructor Detail

Value

public Value()
Default ctor.

Method Detail

getContainerType

public abstract int getContainerType()
This method determines which container is being used in the abstract base class in order to avoid typeof constructs.

Returns:
either the constant to designate a Scalar, or a constant to designate a List.
See Also:
SCALAR, LIST

getSymbolicType

public abstract String getSymbolicType()
This method determines which container is being used in the abstract base class in order to kludgy statements when printing debug info.

Returns:
the symblic identifier for the type of the Value.

clone

public abstract Object clone()
Creates and returns a copy of this object.

Overrides:
clone in class Object
Returns:
a new instance.

getAllLFN

public abstract List getAllLFN(int linkage)
Determines all LFN instances of a given scalar that match the specified linkage. This is a higher-level method employing the given API.

Parameters:
linkage - is the linkage to check for, -1 for all filenames.
Returns:
a set of logical filename instances that match the linkage and were part of the scalar. The result may be an empty set, if no such result were to be found.
See Also:
LFN

getLFNList

public abstract List getLFNList(int linkage)
Determines all LFN instances of a given scalar that match the specified linkage. This is a higher-level method employing the given API. Note that also linkage of NONE will not be found in wildcard search mode.

Parameters:
linkage - is the linkage to check for, -1 for all filenames.
Returns:
a set of all logical filenames that match the linkage and were part of the scalar. The result may be an empty set, if no such result were to be found. For a linkage of -1, complete LFNs will be returned, for any other linkage, just the filename will be returned.
See Also:
Derivation.getLFNList( int ), LFN

containsLFN

public abstract boolean containsLFN(String filename,
                                    int linkage)
Determines if the Value contains an LFN of the specified linkage. The logic uses short-circuit evaluation, thus finding things is faster than not finding things. Searching a list is a potentially expensive method.

Parameters:
filename - is the name of the LFN
linkage - is the linkage to check for, -1 for any linkage type.
Returns:
true if the LFN is contained in the scalar, false otherwise.
See Also:
LFN, Derivation.containsLFN( String, int )

isInRange

public static boolean isInRange(int x)
Predicate function to determine, if a container type is within the legal range of values.

Parameters:
x - is the container type
Returns:
true, if the type is within the legal range, or false, if the container type is outside legal range.
See Also:
SCALAR, LIST

getName

public String getName()
Deprecated. the attribute is currently unused.

Accessor method. Obtains the current state of the thus named attribute.

Returns:
the current state of the m_name attribute.
See Also:
setName(String)

setName

public void setName(String name)
Deprecated. the name attribute is currently unused.

Accessor method. Sets the attribute of same name to a new value.

Parameters:
name - is the new value to overwrite the current state with.
See Also:
getName()


Copyright © 2007 The University of Southern California. All Rights Reserved.