org.apache.fluo.api.data.Bytes.compareTo()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(66)

本文整理了Java中org.apache.fluo.api.data.Bytes.compareTo()方法的一些代码示例,展示了Bytes.compareTo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bytes.compareTo()方法的具体详情如下:
包路径:org.apache.fluo.api.data.Bytes
类名称:Bytes
方法名:compareTo

Bytes.compareTo介绍

[英]Compares this to the passed bytes, byte by byte, returning a negative, zero, or positive result if the first sequence is less than, equal to, or greater than the second. The comparison is performed starting with the first byte of each sequence, and proceeds until a pair of bytes differs, or one sequence runs out of byte (is shorter). A shorter sequence is considered less than a longer one.
[中]将其与传递的字节逐字节进行比较,如果第一个序列小于、等于或大于第二个序列,则返回负、零或正结果。从每个序列的第一个字节开始执行比较,直到一对字节不同,或者一个序列的字节不足(更短)。较短的序列被认为比较长的序列小。

代码示例

代码示例来源:origin: org.apache.fluo/fluo-core

public boolean contains(Bytes row) {
 return (prevEndRow == null || row.compareTo(prevEndRow) > 0)
   && (endRow == null || row.compareTo(endRow) <= 0);
}

代码示例来源:origin: apache/fluo

@Override
public int compareTo(Column other) {
 if (this == other) {
  return 0;
 }
 int result = family.compareTo(other.family);
 if (result == 0) {
  result = qualifier.compareTo(other.qualifier);
  if (result == 0) {
   result = visibility.compareTo(other.visibility);
  }
 }
 return result;
}

代码示例来源:origin: apache/fluo

public boolean contains(Bytes row) {
 return (prevEndRow == null || row.compareTo(prevEndRow) > 0)
   && (endRow == null || row.compareTo(endRow) <= 0);
}

代码示例来源:origin: org.apache.fluo/fluo-api

@Override
public int compareTo(Column other) {
 if (this == other) {
  return 0;
 }
 int result = family.compareTo(other.family);
 if (result == 0) {
  result = qualifier.compareTo(other.qualifier);
  if (result == 0) {
   result = visibility.compareTo(other.visibility);
  }
 }
 return result;
}

代码示例来源:origin: org.apache.fluo/fluo-api

@Override
 public int compareTo(RowColumnValue o) {

  if (this == o) {
   return 0;
  }

  int result = row.compareTo(o.row);
  if (result == 0) {
   result = col.compareTo(o.col);
   if (result == 0) {
    result = val.compareTo(o.val);
   }
  }
  return result;
 }
}

代码示例来源:origin: apache/fluo

@Override
 public int compareTo(RowColumnValue o) {

  if (this == o) {
   return 0;
  }

  int result = row.compareTo(o.row);
  if (result == 0) {
   result = col.compareTo(o.col);
   if (result == 0) {
    result = val.compareTo(o.val);
   }
  }
  return result;
 }
}

代码示例来源:origin: apache/fluo

@Override
public int compareTo(ColumnValue o) {
 if (this == o) {
  return 0;
 }
 int comp = column.compareTo(o.column);
 if (comp == 0) {
  comp = val.compareTo(o.val);
 }
 return comp;
}

代码示例来源:origin: org.apache.fluo/fluo-api

@Override
 public int compareTo(RowColumn other) {

  if (this == other) {
   return 0;
  }

  int result = row.compareTo(other.row);
  if (result == 0) {
   result = col.compareTo(other.col);
  }
  return result;
 }
}

代码示例来源:origin: org.apache.fluo/fluo-api

@Override
public int compareTo(ColumnValue o) {
 if (this == o) {
  return 0;
 }
 int comp = column.compareTo(o.column);
 if (comp == 0) {
  comp = val.compareTo(o.val);
 }
 return comp;
}

代码示例来源:origin: apache/fluo

@Override
 public int compareTo(RowColumn other) {

  if (this == other) {
   return 0;
  }

  int result = row.compareTo(other.row);
  if (result == 0) {
   result = col.compareTo(other.col);
  }
  return result;
 }
}

代码示例来源:origin: org.apache.fluo/fluo-core

@Override
 public int compareTo(TableRange o) {
  if (Objects.equals(getEndRow(), o.getEndRow())) {
   // this will catch case of both null
   return 0;
  }

  if (getEndRow() == null) {
   return 1;
  }

  if (o.getEndRow() == null) {
   return -1;
  }

  return getEndRow().compareTo(o.getEndRow());
 }
}

相关文章