de.lmu.ifi.dbs.elki.data.type
Class AlternativeTypeInformation

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.data.type.AlternativeTypeInformation
All Implemented Interfaces:
TypeInformation

public class AlternativeTypeInformation
extends Object
implements TypeInformation

Class that combines multiple type restrictions into one using the "or" operator.


Field Summary
private  TypeInformation[] restrictions
          The wrapped type restrictions
 
Constructor Summary
AlternativeTypeInformation(TypeInformation... restrictions)
          Constructor.
 
Method Summary
 boolean isAssignableFrom(Object other)
          Test whether this type is assignable from a given object instance.
 boolean isAssignableFromType(TypeInformation type)
          Test whether this type is assignable from another type.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

restrictions

private final TypeInformation[] restrictions
The wrapped type restrictions

Constructor Detail

AlternativeTypeInformation

public AlternativeTypeInformation(TypeInformation... restrictions)
Constructor.

Parameters:
restrictions -
Method Detail

isAssignableFromType

public boolean isAssignableFromType(TypeInformation type)
Description copied from interface: TypeInformation
Test whether this type is assignable from another type.

Specified by:
isAssignableFromType in interface TypeInformation
Parameters:
type - Other type
Returns:
true when the other type is accepted as subtype.

isAssignableFrom

public boolean isAssignableFrom(Object other)
Description copied from interface: TypeInformation
Test whether this type is assignable from a given object instance.

Specified by:
isAssignableFrom in interface TypeInformation
Parameters:
other - Other object
Returns:
true when the other type is an acceptable instance.

toString

public String toString()
Overrides:
toString in class Object

Release 0.4.0 (2011-09-20_1324)