Flash Games

 FAQ   Search   Members   Groups   Register  User Control Panel      Login 

Your time now:
Sat Nov 21, 2009 7:44 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ]  Bookmark and Share
Author Message
 Post subject: new in java.
PostPosted: Thu Oct 30, 2008 3:39 pm 
Offline

Joined: Sat Aug 09, 2008 6:20 pm
Posts: 16
I am generating data(e.g., 24, 16, 32, 38) in a row/column of a table. Now the data is displaying in random order. I want to display them in Descending order. Can anybody help me how to do this as I am new in Java development.

I am displaying the data using these lines of code:
case 1:
{
return history.getRssi();
}

From this Method:

public Object getValueAt( int row, int col )
{
if( null != histories && 0 <= row && row < getRowCount() )
{
try
{
History history = histories[row];
switch( col )
{
case 0:
return ( history.getCheckinTS().length() > 5 ) ? history.getCheckinTS().substring(5) : history.getCheckinTS();
case 1:
{
return history.getRssi();
}
case 2:
return history.getDeviceId();
} // switch
}
catch( Exception e )
{
System.out.println( "exception:" + e.toString() );
System.out.println( e.getStackTrace().toString() );
}
} // if ( null != tags && 0 <= row && row < tags.length )
return "";
}


Top
 Profile  
 
 Post subject: new in java
PostPosted: Tue Nov 04, 2008 4:15 pm 
Offline

Joined: Sat Aug 09, 2008 6:20 pm
Posts: 16
I am basically generating the RSSI values(e.g., 24, 16, 32, 38.....) in the RSSI column in a table using return history.getRssi(); in case 1 of the code. Now the data is displaying in random order. I want to display them in Descending order. Can anybody help me how to do this as I am new in Java development. I am setting thr value for RSSI column using history.setRssi( tagHistory.getRssi() ); in the setData() method. For your convenience I am putting the setData() method and the code where I am displaying the values of RSSI column.

**********************************************************
public void setData( Tag _tag, WardenEvent[] _events, Device[] devices )
{
histories = null;
if( _tag != null )
{
History[] tagHistories = _tag.getHistories();
histories = new History[tagHistories.length];
int k = 0;
for( int j = 0; j < tagHistories.length; j++ )
{
History tagHistory = tagHistories[j];
History history = new History();
history.setCheckinTS( tagHistory.getCheckinTS() );
history.setRssi( tagHistory.getRssi() );
history.setDeviceId("");
boolean add = false;
if( devices != null )
{
for( int i=0; i<devices.length; i++ )
{
Device device = devices[i];
if( device.getGUID().equals( tagHistory.getDeviceId() ) && device.getType() != Device.EAC )
{
history.setDeviceId( device.getName() );
add = true;
break;
}
}
}
if( add )
{
histories[k] = history;
k++;
}
}
for( ; k<tagHistories.length; k++ )
{
History EmptyHistory = new History();
EmptyHistory.setCheckinTS( "" );
EmptyHistory.setRssi( "" );
EmptyHistory.setDeviceId( "" );
histories[k] = EmptyHistory;
}
}
tag = _tag;
events = _events;
}

******************************************************

The code where I am displaying the RSSI values:

public Object getValueAt( int row, int col )
{
if( null != histories && 0 <= row && row < getRowCount() )
{
try
{
History history = histories[row];
switch( col )
{
case 0:
return ( history.getCheckinTS().length() > 5 ) ? history.getCheckinTS().substring(5) : history.getCheckinTS();
case 1:
return history.getRssi();
case 2:
return history.getDeviceId();
} // switch
}
catch( Exception e )
{
System.out.println( "exception:" + e.toString() );
System.out.println( e.getStackTrace().toString() );
}
} // if ( null != tags && 0 <= row && row < tags.length )
return "";
} // public Object getValueAt( int row, int col )


Top
 Profile  
 
 Post subject: Re: new in java.
PostPosted: Sat Jan 17, 2009 11:33 am 
Offline

Joined: Sat Jan 17, 2009 8:12 am
Posts: 8
woho both of you gave us a great information about java i think its really helpful for anybody so thanks for these posts...

_________________
Web design services l New York Web Design


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review


Webmaster - Excruciating - Johnathan - Kotik - Ash - Tomi - rangana - Phate - dflynn - Medley