io.qt.core.QElapsedTimer Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.core;
import io.qt.*;
/**
* Fast way to calculate elapsed times
* Java wrapper for Qt class QElapsedTimer
*/
public class QElapsedTimer extends QtObject
implements java.lang.Comparable,
java.lang.Cloneable
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Java wrapper for Qt enum QElapsedTimer::ClockType
*/
public enum ClockType implements QtEnumerator {
/**
* Representing QElapsedTimer:: SystemTime
*/
SystemTime(0),
/**
* Representing QElapsedTimer:: MonotonicClock
*/
MonotonicClock(1),
@Deprecated
/**
* Representing QElapsedTimer:: TickCounter
* @deprecated Not supported anymore. Use PerformanceCounter instead.
*/
TickCounter(2),
/**
* Representing QElapsedTimer:: MachAbsoluteTime
*/
MachAbsoluteTime(3),
/**
* Representing QElapsedTimer:: PerformanceCounter
*/
PerformanceCounter(4);
static {
QtJambi_LibraryUtilities.initialize();
}
private ClockType(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull ClockType resolve(int value) {
switch (value) {
case 0: return SystemTime;
case 1: return MonotonicClock;
case 2: return TickCounter;
case 3: return MachAbsoluteTime;
case 4: return PerformanceCounter;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* See QElapsedTimer:: QElapsedTimer()
*/
public QElapsedTimer(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QElapsedTimer instance);
/**
* See QElapsedTimer:: QElapsedTimer(QElapsedTimer)
*/
public QElapsedTimer(io.qt.core.@NonNull QElapsedTimer other){
super((QPrivateConstructor)null);
initialize_native(this, other);
}
private native static void initialize_native(QElapsedTimer instance, io.qt.core.QElapsedTimer other);
/**
* See QElapsedTimer:: durationElapsed()const
* This function was introduced in Qt 6.6.
*/
@QtUninvokable
public final java.time.@NonNull Duration durationElapsed(){
return durationElapsed_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.time.Duration durationElapsed_native_constfct(long __this__nativeId);
/**
* See QElapsedTimer:: durationTo(QElapsedTimer)const
* This function was introduced in Qt 6.6.
*/
@QtUninvokable
public final java.time.@NonNull Duration durationTo(io.qt.core.@NonNull QElapsedTimer other){
return durationTo_native_cref_QElapsedTimer_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(other));
}
@QtUninvokable
private native java.time.Duration durationTo_native_cref_QElapsedTimer_constfct(long __this__nativeId, long other);
/**
* See QElapsedTimer:: elapsed()const
*/
@QtUninvokable
public final long elapsed(){
return elapsed_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native long elapsed_native_constfct(long __this__nativeId);
/**
* See QElapsedTimer:: hasExpired(qint64)const
*/
@QtUninvokable
public final boolean hasExpired(long timeout){
return hasExpired_native_qint64_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), timeout);
}
@QtUninvokable
private native boolean hasExpired_native_qint64_constfct(long __this__nativeId, long timeout);
/**
* See QElapsedTimer:: invalidate()
*/
@QtUninvokable
public final void invalidate(){
invalidate_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void invalidate_native(long __this__nativeId);
/**
* See QElapsedTimer:: isValid()const
*/
@QtUninvokable
public final boolean isValid(){
return isValid_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isValid_native_constfct(long __this__nativeId);
/**
* See QElapsedTimer:: msecsSinceReference()const
*/
@QtUninvokable
public final long msecsSinceReference(){
return msecsSinceReference_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native long msecsSinceReference_native_constfct(long __this__nativeId);
/**
* See QElapsedTimer:: msecsTo(QElapsedTimer)const
*/
@QtUninvokable
public final long msecsTo(io.qt.core.@NonNull QElapsedTimer other){
return msecsTo_native_cref_QElapsedTimer_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(other));
}
@QtUninvokable
private native long msecsTo_native_cref_QElapsedTimer_constfct(long __this__nativeId, long other);
/**
* See QElapsedTimer:: nsecsElapsed()const
*/
@QtUninvokable
public final long nsecsElapsed(){
return nsecsElapsed_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native long nsecsElapsed_native_constfct(long __this__nativeId);
/**
* See operator<(QElapsedTimer, QElapsedTimer)
*/
@QtUninvokable
private final boolean operator_less(io.qt.core.@NonNull QElapsedTimer rhs){
return operator_less_native_cref_QElapsedTimer(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(rhs));
}
@QtUninvokable
private native boolean operator_less_native_cref_QElapsedTimer(long __this__nativeId, long rhs);
/**
* See operator==(QElapsedTimer, QElapsedTimer)
*/
@QtUninvokable
public final boolean equals(io.qt.core.@NonNull QElapsedTimer rhs){
return equals_native_cref_QElapsedTimer(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(rhs));
}
@QtUninvokable
private native boolean equals_native_cref_QElapsedTimer(long __this__nativeId, long rhs);
/**
*
*/
@QtUninvokable
public final long restart(){
return restart_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native long restart_native(long __this__nativeId);
/**
* See QElapsedTimer:: secsTo(QElapsedTimer)const
*/
@QtUninvokable
public final long secsTo(io.qt.core.@NonNull QElapsedTimer other){
return secsTo_native_cref_QElapsedTimer_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(other));
}
@QtUninvokable
private native long secsTo_native_cref_QElapsedTimer_constfct(long __this__nativeId, long other);
/**
*
*/
@QtUninvokable
public final void start(){
start_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void start_native(long __this__nativeId);
/**
* See QElapsedTimer:: clockType()
*/
public static io.qt.core.QElapsedTimer.@NonNull ClockType clockType(){
return io.qt.core.QElapsedTimer.ClockType.resolve(clockType_native());
}
private native static int clockType_native();
/**
* See QElapsedTimer:: isMonotonic()
*/
public native static boolean isMonotonic();
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QElapsedTimer(QPrivateConstructor p) { super(p); }
/**
* See operator==(QElapsedTimer, QElapsedTimer)
*/
@Override
@QtUninvokable
public boolean equals(Object other) {
if (other==null || other instanceof io.qt.core.QElapsedTimer) {
return equals((io.qt.core.QElapsedTimer) other);
}
return false;
}
/**
* See operator<(QElapsedTimer, QElapsedTimer)
*/
@QtUninvokable
public int compareTo(io.qt.core.@StrictNonNull QElapsedTimer other) {
if (equals(other)) return 0;
else if (operator_less(other)) return -1;
else return 1;
}
/**
* Returns the objects's hash code computed by qHash(QElapsedTimer)
.
*/
@QtUninvokable
@Override
public int hashCode() {
return hashCode_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native static int hashCode_native(long __this_nativeId);
/**
* Creates and returns a copy of this object.
*/
@QtUninvokable
@Override
public QElapsedTimer clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private static native QElapsedTimer clone_native(long __this_nativeId);
}