<commit_before>package chapter3_cf

/**
	常量池中integer
 */
type ConstantIntegerInfo struct {

}

/**
	常量池中float
 */
type ConstantFloatInfo struct {

}

/**
	常量池中long
 */
type ConstantLongInfo struct {

}

/**
	常量池中double
 */
type ConstantDoubleInfo struct {

}<commit_msg>constant nums<commit_after>package chapter3_cf

import "math"

/**
	常量池中integer
	四字节存储整数常量
	CONSTANT_INTEGER_INFO {
		u1 tag;
		u4 bytes;
	}
 */
type ConstantIntegerInfo struct {
	//实际上，比int小的boolean、byte、short、char也可以放在里面
	val int32
}

func (self *ConstantIntegerInfo) readInfo(reader *ClassReader) {
	bytes := reader.readUint32()
	self.val = int32(bytes)
}

/**
	常量池中float
	四字节
	CONSTANT_FLOAT_INFO {
		u1 tag;
		u4 bytes;
	}
 */
type ConstantFloatInfo struct {
	val float32
}

func (self *ConstantFloatInfo) readInfo(reader *ClassReader) {
	bytes := reader.readUint32()
	self.val = math.Float32frombits(bytes)
}

/**
	常量池中long
	特殊一些 八字节，分成高8字节和低8字节
	CONSTANT_LONG_INFO {
		u1 tag;
		u4 high_bytes;
		u4 low_bytes;
	}
 */
type ConstantLongInfo struct {
	val int64
}

func (self *ConstantLongInfo) readInfo(reader *ClassReader) {
	bytes := reader.readUint64()
	self.val = int64(bytes)
}

/**
	常量池中double
	同样特殊 八字节
	CONSTANT_DOUBLE_INFO {
		u1 tag;
		u4 high_bytes;
		u4 low_bytes;
	}
 */
type ConstantDoubleInfo struct {
	val float64
}

func (self *ConstantDoubleInfo) readInfo(reader *ClassReader) {
	bytes := reader.readUint64()
	self.val = math.Float64frombits(bytes)
}
{'fraction_non_alphanumeric': 0.1101871101871102, 'fraction_numerical': 0.026334026334026334, 'mean_word_length': 4.250909090909091, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6700851', 'n_tokens_mistral': 615, 'n_tokens_neox': 615, 'n_words': 114}