id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
d22a9df1-76c3-481f-b673-ab74c0772d6f | public Parameter[] getNativeParameters() {
return parameters;
} |
00556227-a839-4bd9-98d8-97dc5abef635 | public ArrayParameter getParameters() {
return (ArrayParameter) parameters[0];
} |
12bb9bb1-76f4-463e-8d44-75e9adabb982 | @SuppressWarnings("unchecked")
public <T extends Parameter> T getParameter(final String paramName) {
T parameter = null;
for (Parameter param : parameters) {
if (param.getName().equals(paramName)) {
parameter = (T) param;
}
}
if (parameter == n... |
6c2e1716-24a9-4749-a66e-d6aa160cfaa8 | public String toJSONString(final EncodeMode encodeMode) throws Exception {
return new Encoder().encode(name, parameters, encodeMode);
} |
360da3e1-27ce-49b0-917a-e682f74d6160 | public String toJSONStringPretty(final EncodeMode encodeMode) throws JSONException {
String msgText = new Encoder().encode(name, parameters, encodeMode);
JSONObject jsonObject = new JSONObject(msgText);
return jsonObject.toString(INDENT_FACTOR);
} |
d0272102-3572-4446-81d0-8458c10f2449 | String encode(final String name, final Parameter[] parameters, final Message.EncodeMode encodeMode) throws JSONException {
String encodedMessage = null;
if (parameters != null && name != null) {
final JSONObject message = new JSONObject();
message.put(name, ((Arra... |
cf289010-714e-4084-8514-c511544a63bf | void decode(final String msgText, final Message message) throws JSONException {
final JSONObject jsonObject = new JSONObject(msgText);
final JSONArray names = jsonObject.names();
if (names.length() == 1) {
final String firstName = (String) (names.get(0));
... |
c9761a89-1e23-4ea3-800f-8cbd5c82291e | private Parameter[] decodeParams(final JSONObject jsonObject) throws JSONException {
final Iterator<?> keys = jsonObject.keys();
final ArrayList<Parameter> paramArray = new ArrayList<Parameter>();
while (keys.hasNext()) {
String key = (String) keys.next();
... |
4ac446b1-fe3c-4e60-84d4-e2388ae691ac | private ArrayParameter decodeParams(final JSONArray params) throws JSONException {
final ArrayParameter arrayParameter = new ArrayParameter("");
for (int i = 0; i < params.length(); i++) {
arrayParameter.add(decodeParam(params.get(i)));
}
return arrayParam... |
efd4c8b2-abda-46b8-bc76-fc13b8a664b2 | private Parameter decodeParam(Object obj) throws JSONException {
Parameter param = null;
final String paramName = "";
if (obj instanceof JSONObject) {
JSONObject jsonParam = (JSONObject) obj;
GroupedParameter groupedParam = new GroupedParameter("");
... |
a576935c-fac0-4ed8-8206-f95b8bd452f4 | public IntegerArrayParameter(final int[] ia) {
super("", intArrayToArrayList(ia));
} |
e41d42d9-619c-4355-af47-a1be657522f7 | public IntegerArrayParameter(final String name, final int[] ia) {
super(name, intArrayToArrayList(ia));
} |
f0c96383-0b76-41e4-a848-7b9d4afcc8b3 | @Override
public void add(final Parameter param) {
throw new IllegalStateException("Don't support adding a Parameter to this type.");
} |
dc03dfbc-0a67-413e-89b6-edb2523e09cd | private static ArrayList<Parameter> intArrayToArrayList(final int[] ia) {
final ArrayList<Parameter> arrayList = new ArrayList<Parameter>();
if (ia != null) {
for (int i = 0; i < ia.length; i++) {
arrayList.add(new SingleParameter("" + i, ia[i]));
}
}
... |
12f291d4-c2a8-4aef-a4b5-e9f1078f4792 | JSONArray toJSONArray(final Message.EncodeMode encodeMode) {
JSONArray jsonArray = null;
if (values != null) {
jsonArray = new JSONArray();
for (int i = 0; i < values.size(); i++) {
int x = (Integer) (values.get(i).getValue());
jsonArray.put(x);
... |
e1ca7509-ef4d-473d-966b-609c5fed6bda | public Parameter(final String name, final Object value) {
this.name = name;
this.value = value;
} |
4dbad082-8562-46da-8f6e-3bd45d98bae3 | public String getName() {
return name;
} |
cc29926e-67c4-4076-9a18-24a1a48fc23a | void setName(final String name) {
this.name = name;
} |
03a83741-7df0-4e85-9c82-85d6afa59b89 | public Object getValue() {
return value;
} |
e608b237-3bfe-4e52-9155-4df4b2cf1dae | public void setValue(final Object value) {
this.value = value;
} |
6ba49958-82e0-495e-b537-1d0956d14fc4 | public ByteArrayParameter(final byte[] ba) {
super("", byteArrayToArrayList(ba));
} |
f5d66e50-ad8a-42c6-94ef-c813318e83a1 | public ByteArrayParameter(final String name, final byte[] ba) {
super(name, byteArrayToArrayList(ba));
} |
c0e915d5-7072-4323-90f1-e892a00bc1e0 | @Override
public void add(final Parameter param) {
throw new IllegalStateException("Don't support adding a Parameter to this type.");
} |
6bf87ada-8c63-42b2-b533-04dfd70da5a2 | private static ArrayList<Parameter> byteArrayToArrayList(final byte[] ba) {
final ArrayList<Parameter> arrayList = new ArrayList<Parameter>();
if (ba != null) {
for (int i = 0; i < ba.length; i++) {
arrayList.add(new SingleParameter("" + i, byteToInt(ba[i])));
}
... |
be389d0b-d3e3-499f-915c-e3059397d4b4 | private static int byteToInt(final byte b) {
int i = b;
if (b < 0) {
i = 256 + b;
}
return i;
} |
126709a9-2eb3-4553-88b6-0c81603add13 | private static byte intToByte(final int i) throws Exception {
if (i < 0 || i > 255) {
throw new IllegalArgumentException("Invalid byte value " + i);
}
return (byte) i;
} |
eae89902-1b88-4f58-87d9-5522ec56548f | JSONArray toJSONArray(final Message.EncodeMode encodeMode) {
JSONArray jsonArray = null;
if (values != null) {
jsonArray = new JSONArray();
for (int i = 0; i < values.size(); i++) {
int intValue = (Integer) (values.get(i).getValue());
jsonArray.put... |
caeb975c-00b9-4c8f-a3d9-95f4c13b2bd0 | public static byte[] decodeByteArray(Object obj) throws Exception {
byte[] ba = null;
if (obj instanceof ArrayParameter) {
final ArrayParameter arrayParameter = (ArrayParameter) obj;
final ArrayList<?> values = arrayParameter.getValues();
ba = new byte[values.size()];... |
26e9f79c-35fc-4214-b64e-197d87483e93 | public ArrayParameter(final String name) {
super(name, null);
values = new ArrayList<Parameter>();
} |
364facb2-84e3-4502-869e-71148130d430 | public ArrayParameter(final String name, final ArrayList<Parameter> values) {
super(name, null);
this.values = values;
} |
910c85f5-2895-4d0b-b7ce-91552feb6f96 | public ArrayList<Parameter> getValues() {
return values;
} |
4a81ffd4-ec12-40ef-a857-f778e2277eb8 | public void add(final Parameter param) {
values.add(param);
} |
1f42ce63-6314-4ee6-9406-750e94bc39a3 | public Parameter get(final String name) {
Parameter parameterToReturn = null;
for (final Parameter param : values) {
if (param.getName().equals(name)) {
parameterToReturn = param;
}
}
if (parameterToReturn == null) {
throw new IllegalAr... |
2e19539b-af05-48cd-b1f2-fdf815fa80b5 | JSONArray toJSONArray(final Message.EncodeMode encodeMode) throws JSONException {
JSONArray jsonArray = null;
if (values != null) {
jsonArray = new JSONArray();
for (int i = 0; i < values.size(); i++) {
Parameter param = values.get(i);
if (encodeMo... |
f19e86e1-bc6c-4a5d-84a7-d4ada9266d92 | public BooleanArrayParameter(final boolean[] ba) {
super("", booleanArrayToArrayList(ba));
} |
5f15c39b-1064-4ccf-bf1e-e5bb83d98631 | public BooleanArrayParameter(final String name, final boolean[] ba) {
super(name, booleanArrayToArrayList(ba));
} |
ae6f818a-5c78-4287-b9db-b89427ad22a5 | @Override
public void add(final Parameter param) {
throw new IllegalStateException("Don't support adding a Parameter to this type.");
} |
eb9d71c8-e620-489f-9d86-0bc9422e7e0a | private static ArrayList<Parameter> booleanArrayToArrayList(final boolean[] ba) {
final ArrayList<Parameter> arrayList = new ArrayList<Parameter>();
if (ba != null) {
for (int i = 0; i < ba.length; i++) {
arrayList.add(new SingleParameter("" + i, ba[i]));
}
... |
e1d97128-32d4-46b4-b4e6-660585f5f07d | JSONArray toJSONArray(final Message.EncodeMode encodeMode) {
JSONArray jsonArray = null;
if (values != null) {
jsonArray = new JSONArray();
for (int i = 0; i < values.size(); i++) {
boolean b = (Boolean) (values.get(i).getValue());
jsonArray.put(b)... |
2f9300c7-4c83-4d6d-bd8a-0e8495e724da | public SingleParameter(final String name, final Object value) {
super(name, value);
setValue(value);
} |
3ec217d9-7ba0-486e-96c7-2eb03eaa10ef | @Override
public void setValue(Object value) {
if (value instanceof Byte) {
byte byteValue = (Byte) value;
if (byteValue >= 0) {
value = new Integer(byteValue);
} else {
value = new Integer(256 + byteValue);
}
} else {
... |
d92d77b1-6dd1-48f8-9834-d8bc106cd5f5 | public static Integer decodeInteger(final Object obj) throws Exception {
Integer intValue = null;
if (obj instanceof SingleParameter) {
SingleParameter param = (SingleParameter) obj;
intValue = (Integer) param.getValue();
} else {
throw new IllegalArgumentExce... |
f242621d-7598-45a6-927d-4afb7be6b21b | public static Long decodeLong(final Object obj) throws Exception {
Long longValue = null;
if (obj instanceof SingleParameter) {
SingleParameter param = (SingleParameter) obj;
longValue = (Long) param.getValue();
} else {
throw new IllegalArgumentException("Arg... |
a270051d-84d4-4bc3-892a-b83ae04d4396 | public static Boolean decodeBoolean(final Object obj) throws Exception {
Boolean booleanValue = null;
if (obj instanceof SingleParameter) {
SingleParameter param = (SingleParameter) obj;
booleanValue = (Boolean) param.getValue();
} else {
throw new IllegalArgu... |
5c257b3c-9b26-4f29-96d7-060a82d3ff7d | public static String decodeString(final Object obj) throws Exception {
String stringValue = null;
if (obj instanceof SingleParameter) {
SingleParameter param = (SingleParameter) obj;
stringValue = (String) param.getValue();
} else {
throw new IllegalArgumentEx... |
9e5853d6-41be-40a1-bd37-8f0e05eec1ad | public static Byte decodeByte(final Object obj) throws Exception {
Byte byteValue = null;
Integer intValue = decodeInteger(obj);
if (intValue < 0 || intValue > 255) {
throw new IllegalArgumentException("Invalid byte value " + intValue);
}
byteValue = new Byte((byte) (... |
45c478f8-5984-462f-b64a-4bf46c6cc925 | @BeforeClass
public static void setUp() {
verbose = true;
} |
6c8c2505-5573-4ca0-8fd8-c1549b8ac4d1 | @Test
public void testArrayParameter_get() {
final ArrayParameter arrayParam = new ArrayParameter("arrayParam");
final SingleParameter ap0 = new SingleParameter("arrayEntry0", "avalue0");
final SingleParameter ap1 = new SingleParameter("arrayEntry1", "avalue1");
final SingleParameter... |
44326dab-089a-40ec-aaaf-da0048b12c56 | @Test
public void testMessage_getParameter() {
final ArrayParameter arrayParam = new ArrayParameter("arrayParam");
arrayParam.add(new SingleParameter("arrayEntry0", "avalue0"));
arrayParam.add(new SingleParameter("arrayEntry1", "avalue1"));
arrayParam.add(new SingleParameter("arrayEn... |
39ff55c5-e5e7-429f-88fd-e2f565733d51 | @Test
public void testBasic() throws Exception {
final ArrayParameter params = new ArrayParameter("");
params.add(new SingleParameter("param0", "value0"));
params.add(new SingleParameter("param1", 42));
params.add(new SingleParameter("param2", true));
final ArrayParameter pa... |
bb29dad7-61d1-4196-afc9-8caf7f937fbb | @Test
public void testMessage_fromJSONObjectWithOnlyOneField() throws Exception {
final String json = "{\"String\":\"strValue\",\"Object\":{\"objChildString\":\"objChildStrValue\"}}";
final Message message = new Message(json);
final String json2 = message.toJSONString(EncodeMode.VERBOSE);
... |
6fa604df-2301-48a9-9fb4-f66fbbcac2bc | @Test
public void testMessage_fromJSONArray() throws Exception {
final String json = "{\"AVPS\":[\"263\",\"UTF8String\",\"1234787711756\",\"293\",\"DiamIdent\",\"peer5.ericsson.com\",\"283\",\"DiamIdent\",\"ericsson.com\",\"296\",\"DiamIdent\",\"ericsson.com\",\"264\",\"DiamIdent\",\"cgw-1-tocs.ericsson.com... |
4bd904bb-397f-4478-afe1-32cb3d67fee2 | @Test
public void _testEncodeDecodeStandardJSON() throws Exception {
final JSONObject obj1 = new JSONObject(staticStandardMsgText);
final String formattedString1 = obj1.toString(4);
if (isVerbose())
System.out.println(formattedString1);
final JSONObject obj2 = new JSONOb... |
a1eeaed2-40b0-4776-bbf6-2961c7d221c9 | protected void assertEquals(Message xmessage, Message message) {
assertEquals(xmessage.getParameters(), message.getParameters());
} |
eba9f235-087b-4241-932a-7ea2b194c24a | protected void assertEquals(ArrayParameter xparams, Object obj) {
ArrayParameter params = (ArrayParameter) obj;
assertEquals(xparams.getValues(), params.getValues());
} |
66908db5-5fda-46eb-994b-acd8daa6cbbd | protected void assertEquals(ArrayList<?> xlist, ArrayList<?> list) {
Assert.assertEquals(xlist.size(), list.size());
for (int i = 0; i < xlist.size(); i++) {
Object obj = xlist.get(i);
if (obj instanceof ArrayParameter) {
assertEquals((ArrayParameter) obj, list.ge... |
647a3f0b-7e89-462c-a87b-826acaca2f90 | protected void assertEquals(SingleParameter xparam, Object obj) {
SingleParameter param = (SingleParameter) obj;
Object xvalue = xparam.getValue();
if (xvalue instanceof String) {
Assert.assertEquals((String) xvalue, (String) param.getValue());
} else if (xvalue instanceof In... |
092e52bb-8300-4a5b-b976-f04f9309521e | protected void assertEquals(GroupedParameter exp, Object obj) {
GroupedParameter got = (GroupedParameter) obj;
Assert.assertNotNull(got);
Assert.assertEquals(exp.getName(), got.getName());
Assert.assertEquals(exp.getValues(), got.getValues());
} |
24ea4581-027b-4400-bb0e-ede37c8414a6 | private void showMessage(Message message) throws Exception {
if (isVerbose()) {
showMessageCompact(message);
showMessagePrettyCompact(message);
showMessageVerbose(message);
showMessagePrettyVerbose(message);
}
} |
6c552f1a-2731-474b-abe6-4b8482e547da | private void showMessageCompact(Message message) throws Exception {
String compactMsgText = message.toJSONString(Message.EncodeMode.COMPACT);
System.out.println("Compact, length = " + compactMsgText.length());
System.out.println(" " + compactMsgText);
} |
f034e4bf-ea82-46fa-ad96-26814cc0177e | private void showMessageVerbose(Message message) throws Exception {
String verboseMsgText = message.toJSONString(Message.EncodeMode.VERBOSE);
System.out.println("Verbose, length = " + verboseMsgText.length());
System.out.println(" " + verboseMsgText);
} |
1844618b-3a26-41e9-a768-44109d8ba72e | private void showMessagePrettyCompact(Message message) throws Exception {
System.out.println("Pretty - compact");
System.out.println(" " + message.toJSONStringPretty(Message.EncodeMode.COMPACT));
} |
b8a696b0-ea08-4256-b9dc-42dd072ece08 | private void showMessagePrettyVerbose(Message message) throws Exception {
System.out.println("Pretty - verbose");
System.out.println(" " + message.toJSONStringPretty(Message.EncodeMode.VERBOSE));
} |
550fd9d7-265c-47fe-a6a6-bffc967a8860 | private boolean isVerbose() {
return verbose;
} |
41b40aa8-52ad-461b-9f97-10a9601d86a8 | public void init() throws PortletException {
super.init();
ExpandoTable table = null;
long companyId = PortalUtil.getDefaultCompanyId();
try {
table = ExpandoTableLocalServiceUtil.addDefaultTable(
companyId, User.class.getName());
}
catch (DuplicateTableNameException dtne) {
try {
table = Expa... |
a0e3c44f-993f-4908-9640-80e537818ad0 | @Override
public void receive(Message message) throws MessageListenerException {
long companyId = PortalUtil.getDefaultCompanyId();
try {
User user = UserLocalServiceUtil.getUserByEmailAddress(
companyId, PortletPropsValues.DETECT_USER_EMAIL);
ExpandoTable table = ExpandoTableLocalServiceUtil.getDefaul... |
dbc5bdae-7f75-4480-81e1-8bc430751229 | public AssignWireCSA()
{
super("WireCSA","Set WireCSA from device pins","0.2","Set Wire CSA from logical pin attributes");
setPinProperty("WireCSA");
setCavityProperty("WireCSA");
} |
8980a1fd-c470-40fc-a455-3f2062bed2e6 | protected String determineResult(String v1, String v2)
{
if (v1 == null) { return v2; }
if (v2 == null) { return v1; }
double d1 = Double.parseDouble(v1);
double d2 = Double.parseDouble(v2);
if (d1 > d2) {
return v1;
}
return v2;
} |
2538d394-8afc-4936-9d9f-a16c7e973938 | public String getSname() {
return sname;
} |
efefb229-ab85-48f8-bf48-f90bf918963b | public void setSname(String name) {
this.sname = name;
} |
e4a7a1e4-5c48-4c79-b2aa-2cfe1b68fb34 | public float getvalue(String s)
{
String m[]= s.split("/");
float a=1;
float d[]= new float[m.length];
GetFloatValue[] st = new GetFloatValue[m.length];//定义一个实体类数组
for(int i =0;i<m.length;i++)
{
st[i]=new GetFloatValue();
... |
a5c9e37a-94cb-4bfd-964f-8b7ebe7a0321 | protected AssignWireAttributes(String attribute, String name, String version, String description)
{
Calendar c = Calendar.getInstance();//可以对每个时间域单独修改
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH);
int date = c.get(Calendar.DATE);
int hour = c.get(Cale... |
5d036a61-20ee-497e-a078-99370254dbcc | protected abstract String determineResult(String v1, String v2); |
61678cb6-1103-4db3-9350-1725b63c6b06 | protected void setPinProperty(String propName) {
m_pinProp = propName;
} |
0591761a-3d40-455d-be77-c58ef081eb5c | protected void setCavityProperty(String propName) {
m_cavProp = propName;
} |
ceb11990-6009-49f1-947d-300ff0c73487 | public boolean match(IXWire ixWire, IXSignal ixSignal, IXHarness ixHarness, IXAttributesResult ixAttributesResult)
{
String val = wireGetProp(ixWire, ixSignal);
String att= ixWire.getAttribute(m_wireAtt);
if (val != null && val.trim().length() > 0 ) {
//&& (att==null || att=="")
... |
e55c9666-86a4-4d45-a748-0f48373046f3 | private String wireGetProp(IXWire wire, IXSignal sig)
{
String retVal = null;
for (IXAbstractPin pin : wire.getAbstractPins())
{
String val = pinGetProp(pin,sig);
retVal = determineResult(retVal, val);
}
if (retVal == null || retVal.trim().isEmpty())
{
for (IXAbstractConduct... |
188b29cd-0b61-496c-a5b7-19acb44494a6 | private String pinGetProp(IXAbstractPin pin, IXSignal sig)
{
// Only interested in connector cavities
// We ignore splices completely
if (pin instanceof IXCavity)
{
IXCavity cav = (IXCavity)pin;
if (!(cav.getOwner() instanceof IXConnector)) {
return null;
}
IXConnector conn = ... |
64e51aa8-702b-45f9-83b1-5ad0ba2e4108 | private String getValueForCavity(IXCavity cav, IXSignal sig)
{
String retVal = null;
// First check on the cavity itself
if (m_cavProp != null) {
String val = cav.getProperty(m_cavProp);
if (val != null && val.trim().length() > 0) {
return val;
}
... |
ce961bc6-8aef-40f8-87e7-612493d35da3 | private boolean pinConnectsToSignal(IXAbstractPin pin, IXSignal sig)
{
for (IXAbstractConductor cond : pin.getConductors()) {
if (sig.getFunctionalConductors().contains(cond)) {
return true;
}
}
return false;
} |
3b4a0c2d-8fe8-4899-a14f-a3216ca2f6ea | public String getDescription() {
return m_description;
} |
c7a4d29e-f361-4290-9e34-d85ea33d722c | public String getName() {
return m_name;
} |
8f58cec7-4572-460a-a8fa-de16b6d8c8db | public String getVersion() {
return m_version;
} |
b6074ac3-135a-46b2-a5bd-481607be3438 | public AssignWireSpec()
{
super("WireSpec","Set WireSpec from device pins","0.2","Set Wire Specification from logical pin attributes");
setPinProperty("WireSpec");
setCavityProperty("WireSpec");
} |
09c705c4-2570-4ee3-98db-b4b31d40e375 | protected String determineResult(String v1, String v2)
{
if (v1 == null) { return v2; }
if (v2 == null) { return v1; }
GetFloatValue m=new GetFloatValue();
if ((v1 != null && v1.trim().length() > 0) &&((v2 != null && v2.trim().length() > 0)))
{
if ( m.getvalue(v1)... |
46a8ff81-dfa9-450b-a96d-0193e9b8879c | public AssignWireColor()
{
super("WireColor","Set WireColor from device pins","0.2","Set Wire Color from logical pin attributes");
setPinProperty("WireColor");
setCavityProperty("WireColor");
} |
771f04fc-cb36-4ad9-a17b-b8849b7eaf1f | protected String determineResult(String v1, String v2)
{
if (v1 == null) { return v2; }
if (v2 == null) { return v1; }
double d1 = v1.length();
double d2 = v2.length();
if (d1 > d2) {
return v1;
}
return v2;
} |
f9d4a7b3-98ff-48d5-8a65-327c068200a4 | public AssignWireMaterial()
{
super("WireMaterial","Set WireMaterial from device pins","0.2","Set WireMaterial from logical pin attributes");
setPinProperty("WireMaterial");
setCavityProperty("WireMaterial");
} |
cca6945b-3263-43d2-91c1-af1e43c8d5d0 | protected String determineResult(String v1, String v2)
{
if (v1 == null) { return v2; }
if (v2 == null) { return v1; }
double d1 = v1.length();
double d2 = v2.length();
if (d1 > d2) {
return v1;
}
return v2;
} |
12cbdb53-6224-4a72-89f1-a6655f325f38 | MySQL(String ip){
this.ip = ip;
this.connect(); // Connect to the database
} |
5e54fca1-fbe7-42b0-ba05-b19292966599 | public String getURL(){
return "jdbc:mysql://"+this.ip+"/clubdoors";
} |
326cafde-444d-4a41-9630-22c6ca30ae67 | private void connect(){
try{
this.con = DriverManager.getConnection( // Connect
this.getURL(),
"club_user","club_password");
this.stat = this.con.createStatement( // Make a statement
ResultSet.TYPE_SCROLL_INSENSITIVE,
... |
3814c874-dbcd-4142-9a3e-a87307ee9a97 | public void update(String s){
try{
this.connect(); // Reconnect in case the program has been open
// too long and it closed the connection.
this.stat.executeUpdate(s);
} catch(Exception ex){
new ClubException("Error Updating", ex.toString()... |
16c43a55-4175-4d25-a50a-d59e23cbed0f | public int getAmountZ(String type) throws SQLException{
int amount = 0;
this.connect();
ResultSet dataSet = this.stat.executeQuery
("SELECT * FROM tbl_admissions WHERE z=0 AND type='"
+ type
+ "'");
dataSet.afterLast();
whi... |
e74fa8b9-1695-489e-8386-af83a75aa90c | public int[] getAdmissions() throws SQLException{
int[] adm = new int[8];
adm[0] = this.getAmountZ("$5");
adm[1] = this.getAmountZ("$10");
adm[2] = this.getAmountZ("$20");
adm[3] = this.getAmountZ("G-Tix");
adm[4] = this.getAmountZ("Mgr Comp");
adm[5] = this.getA... |
6c6af0e2-1af1-4422-94bf-e9f394776933 | public int getAmountR(String type, int[] f, int[] t) throws SQLException{
int amount = 0; // ^From ^To
this.connect();
ResultSet dataSet = this.stat.executeQuery
("SELECT * FROM tbl_admissions WHERE type='"
+ type + "'"
... |
2fccaac9-c73a-42fa-9f8d-732ac2eb5ada | public int[] getRangeAdmissions(int[] from, int[] to) throws SQLException{
int[] adm = new int[8];
adm[0] = this.getAmountR("$5", from, to);
adm[1] = this.getAmountR("$10", from, to);
adm[2] = this.getAmountR("$20", from, to);
adm[3] = this.getAmountR("G-Tix", from, to);
... |
0a51cc06-8660-4aaa-a4c4-bb8c8a873743 | public void resetZ(){
this.update("UPDATE tbl_admissions SET z=1");
this.update("INSERT INTO last_z VALUES (NOW())");
} |
d67ae93c-e872-4724-b36a-64d35fbe327a | public String lastZ() throws SQLException{
String time = "";
this.connect();
ResultSet dataSet = this.stat.executeQuery
("SELECT * FROM last_z ORDER BY time DESC LIMIT 1");
dataSet.afterLast();
while (dataSet.previous()) {
time = dataSet.getSt... |
94ea9bee-a229-4572-bd9a-ff21da9e85b4 | public int getMonth(){
DateFormat dateFormat = new SimpleDateFormat("MM");
Date date = new Date();
return Integer.parseInt(dateFormat.format(date));
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.