Package elki.data.type
Class AlternativeTypeInformation
- java.lang.Object
-
- elki.data.type.AlternativeTypeInformation
-
- All Implemented Interfaces:
TypeInformation
public class AlternativeTypeInformation extends java.lang.Object implements TypeInformation
Class that combines multiple type restrictions into one using the "or" operator.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private TypeInformation[]
restrictions
The wrapped type restrictions
-
Constructor Summary
Constructors Constructor Description AlternativeTypeInformation(TypeInformation... restrictions)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAssignableFrom(java.lang.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.java.lang.String
toString()
-
-
-
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 interfaceTypeInformation
- Parameters:
type
- Other type- Returns:
- true when the other type is accepted as subtype.
-
isAssignableFrom
public boolean isAssignableFrom(java.lang.Object other)
Description copied from interface:TypeInformation
Test whether this type is assignable from a given object instance.- Specified by:
isAssignableFrom
in interfaceTypeInformation
- Parameters:
other
- Other object- Returns:
- true when the other type is an acceptable instance.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-