All pastes #269871 Raw Edit

Fat

public java v1 · immutable
·published 2006-12-06 21:43 UTC
rendered paste body
/*	Attempt to design a class that can store booleans, strings, ints, doubles, longs, 	and shorts into one array.*/public class Fat{	static int maxCells;	private String fat;	private int cellsUsed;	private String strings = new String[maxCells];	private int ints = new int[maxCells];	private double doubles = new int[maxCells];	private long longs = new long[maxCells];	private short shorts = new short[maxCells];	private boolean booleans = new boolean[maxCells];	public Fat(String nameOfFatObject)	{		fat = nameOfFatObject;		cellsUsed = 0;	}		public void addValue(String someString)	{		strings[cellsUsed] = someString;	}	public void addValue(int someInt)	{		ints[cellsUsed] = someInt;	}	public void addValue(double someDouble)	{		doubles[cellsUsed] = someDouble;	}	public void addValue(long someLong)	{		long[cellsUsed] = someLong;	}	public void addValue(double someBoolean)	{		booleans[cellsUsed] = someBoolean;	}	public void modifyValue(int cell, String someString)	{		strings[cell] = someString;	}	public void modifyValue(int cell, int someInt)	{		ints[cell] = someInt;	}	public void modifyValue(int cell, double someDouble)	{		doubles[cell] = someDouble;	}	public void modifyValue(int cell, long someLong)	{		long[cell] = someLong;	}	public void modifyValue(int cell, double someBoolean)	{		booleans[cell] = someBoolean;	}}