sampleoffset.java

来自「Java version of ABC/HR comparator v0.5. 」· Java 代码 · 共 27 行

JAVA
27
字号
package abchr.audio;

import abchr.Attributable;

public class SampleOffset {
	private static Integer key=new Integer(934201881);

	// in milliseconds
	public static int getOffset(Attributable attributable) {
		Integer offset=(Integer)attributable.getAttribute(key);
		return offset==null?0:offset.intValue();
	}

	public static Integer getOffsetObj(Attributable attributable) {
		Integer offset=(Integer)attributable.getAttribute(key);
		return offset==null?new Integer(0):offset;
	}

	public static void setOffset(Attributable attributable,int offset) {
		attributable.setAttribute(key,new Integer(offset));
	}

	public static void setOffset(Attributable attributable,Integer offset) {
		attributable.setAttribute(key,offset);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?