Class SingleColumnRestriction
- java.lang.Object
-
- org.apache.cassandra.cql3.restrictions.SingleColumnRestriction
-
- All Implemented Interfaces:
Restriction,SingleRestriction
- Direct Known Subclasses:
SingleColumnRestriction.ContainsRestriction,SingleColumnRestriction.EQRestriction,SingleColumnRestriction.INRestriction,SingleColumnRestriction.IsNotNullRestriction,SingleColumnRestriction.LikeRestriction,SingleColumnRestriction.SliceRestriction
public abstract class SingleColumnRestriction extends java.lang.Object implements SingleRestriction
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSingleColumnRestriction.ContainsRestrictionstatic classSingleColumnRestriction.EQRestrictionstatic classSingleColumnRestriction.INRestrictionstatic classSingleColumnRestriction.InRestrictionWithMarkerstatic classSingleColumnRestriction.InRestrictionWithValuesstatic classSingleColumnRestriction.IsNotNullRestrictionstatic classSingleColumnRestriction.LikeRestrictionstatic classSingleColumnRestriction.SliceRestriction
-
Field Summary
Fields Modifier and Type Field Description protected ColumnMetadatacolumnDefThe definition of the column to which apply the restriction.
-
Constructor Summary
Constructors Constructor Description SingleColumnRestriction(ColumnMetadata columnDef)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract SingleRestrictiondoMergeWith(SingleRestriction otherRestriction)java.util.List<ColumnMetadata>getColumnDefs()Returns the column definitions in position order.ColumnMetadatagetFirstColumn()Returns the definition of the first column.ColumnMetadatagetLastColumn()Returns the definition of the last column.booleanhasSupportingIndex(IndexRegistry indexRegistry)Check if the restriction is on indexed columns.protected abstract booleanisSupportedBy(Index index)Check if this type of restriction is supported by the specified index.SingleRestrictionmergeWith(SingleRestriction otherRestriction)Merges this restriction with the specified one.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.cql3.restrictions.Restriction
addFunctionsTo, addRowFilterTo, isOnToken
-
Methods inherited from interface org.apache.cassandra.cql3.restrictions.SingleRestriction
appendBoundTo, appendTo, hasBound, isContains, isEQ, isIN, isInclusive, isLIKE, isMultiColumn, isNotNull, isSlice
-
-
-
-
Field Detail
-
columnDef
protected final ColumnMetadata columnDef
The definition of the column to which apply the restriction.
-
-
Constructor Detail
-
SingleColumnRestriction
public SingleColumnRestriction(ColumnMetadata columnDef)
-
-
Method Detail
-
getColumnDefs
public java.util.List<ColumnMetadata> getColumnDefs()
Description copied from interface:RestrictionReturns the column definitions in position order.- Specified by:
getColumnDefsin interfaceRestriction- Returns:
- the column definitions in position order.
-
getFirstColumn
public ColumnMetadata getFirstColumn()
Description copied from interface:RestrictionReturns the definition of the first column.- Specified by:
getFirstColumnin interfaceRestriction- Returns:
- the definition of the first column.
-
getLastColumn
public ColumnMetadata getLastColumn()
Description copied from interface:RestrictionReturns the definition of the last column.- Specified by:
getLastColumnin interfaceRestriction- Returns:
- the definition of the last column.
-
hasSupportingIndex
public boolean hasSupportingIndex(IndexRegistry indexRegistry)
Description copied from interface:RestrictionCheck if the restriction is on indexed columns.- Specified by:
hasSupportingIndexin interfaceRestriction- Parameters:
indexRegistry- the index registry- Returns:
trueif the restriction is on indexed columns,false
-
mergeWith
public final SingleRestriction mergeWith(SingleRestriction otherRestriction)
Description copied from interface:SingleRestrictionMerges this restriction with the specified one.Restriction are immutable. Therefore merging two restrictions result in a new one. The reason behind this choice is that it allow a great flexibility in the way the merging can done while preventing any side effect.
- Specified by:
mergeWithin interfaceSingleRestriction- Parameters:
otherRestriction- the restriction to merge into this one- Returns:
- the restriction resulting of the merge
-
doMergeWith
protected abstract SingleRestriction doMergeWith(SingleRestriction otherRestriction)
-
isSupportedBy
protected abstract boolean isSupportedBy(Index index)
Check if this type of restriction is supported by the specified index.- Parameters:
index- the secondary index- Returns:
truethis type of restriction is supported by the specified index,falseotherwise.
-
-